summaryrefslogtreecommitdiff
path: root/program/steps/mail/func.inc
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2008-06-09 12:22:54 +0000
committeralecpl <alec@alec.pl>2008-06-09 12:22:54 +0000
commit32b7092759f4c871c6ad2ee9a82dec96046d01f1 (patch)
tree03274171261aee603aa3d5a29731ec1b6dd798e4 /program/steps/mail/func.inc
parenta0530a6ec0cb464ec6eaa63fd211c2ffbe6db9ad (diff)
#1485110
Diffstat (limited to 'program/steps/mail/func.inc')
-rw-r--r--program/steps/mail/func.inc6
1 files changed, 5 insertions, 1 deletions
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, '<meta http-equiv="Content-Type" content="text/html; charset='.RCMAIL_CHARSET.'" />', intval(stripos($html, '</head>')), 0);
// clean HTML with washhtml by Frederic Motte
$body = washtml::wash($html, array(