summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorsvncommit <devs@roundcube.net>2009-07-31 02:57:53 +0000
committersvncommit <devs@roundcube.net>2009-07-31 02:57:53 +0000
commita80b7d416ce744b5f5ce92fce0179dd613dd0207 (patch)
tree3aac66fa2df31f62a3d73e5d156de25279910a55 /program
parent03a63a4a032c1202ddfa4fba53c091953659b153 (diff)
better solution for HTML washing encoding issue
Diffstat (limited to 'program')
-rw-r--r--program/steps/mail/func.inc14
1 files changed, 7 insertions, 7 deletions
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 9928cb150..2a301ae17 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -685,17 +685,17 @@ function rcmail_wash_html($html, $p = array(), $cid_replaces)
// fix (unknown/malformed) HTML tags before "wash"
$html = preg_replace_callback('/(<[\/!]*)([^ >]+)/', 'rcmail_html_tag_callback', $html);
- // charset was converted to UTF-8 in rcube_imap::get_message_part() -> change charset specification in HTML accordingly
+ // charset was converted to UTF-8 in rcube_imap::get_message_part(),
+ // change charset specification in HTML accordingly
$charset_pattern = '/(\s+content=[\'"]?\w+\/\w+;\s*charset)=([a-z0-9-_]+)/i';
if (preg_match($charset_pattern, $html)) {
$html = preg_replace($charset_pattern, '\\1='.RCMAIL_CHARSET, $html);
- } else {
- // add head for malformed messages, washtml cannot work without that
- if (!preg_match('/<head[^>]*>(.*)<\/head>/Uims', $html))
- $html = '<head></head>'. $html;
- $html = substr_replace($html, '<meta http-equiv="content-type" content="text/html; charset='.RCMAIL_CHARSET.'" />', intval(stripos($html, '<head>')+6), 0);
}
-
+ // add head for malformed messages, washtml cannot work without that
+ if (!preg_match('/<head[^>]*>(.*)<\/head>/Uims', $html))
+ $html = '<head></head>'. $html;
+ $html = substr_replace($html, '<meta http-equiv="Content-Type" content="text/html; charset='.RCMAIL_CHARSET.'" />', intval(stripos($html, '<head>')+6), 0);
+
// turn relative into absolute urls
$html = rcmail_resolve_base($html);