From 32b7092759f4c871c6ad2ee9a82dec96046d01f1 Mon Sep 17 00:00:00 2001 From: alecpl Date: Mon, 9 Jun 2008 12:22:54 +0000 Subject: #1485110 --- program/steps/mail/func.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'program') diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index f4b18411e..718461ec2 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -535,7 +535,11 @@ function rcmail_print_body($part, $safe=false, $plain=false) // text/html else if ($part->ctype_secondary == 'html') { // charset was converted to UTF-8 in rcube_imap::get_message_part() -> change charset specification in HTML accordingly - $html = preg_replace('/(\s+content=[\'"]\w+\/\w+;\s+charset)=([a-z0-9-]+)/i', '\\1='.RCMAIL_CHARSET, $part->body); + $html = $part->body; + if(preg_match('/(\s+content=[\'"]\w+\/\w+;\s+charset)=([a-z0-9-]+)/i', $html)) + $html = preg_replace('/(\s+content=[\'"]\w+\/\w+;\s+charset)=([a-z0-9-]+)/i', '\\1='.RCMAIL_CHARSET, $html); + else + $html = substr_replace($html, '', intval(stripos($html, '')), 0); // clean HTML with washhtml by Frederic Motte $body = washtml::wash($html, array( -- cgit v1.2.3