summaryrefslogtreecommitdiff
path: root/roundcubemail/program/steps
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2008-06-09 12:22:54 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2008-06-09 12:22:54 +0000
commit17751006a18b7de87a7bdbc16a2982125194a933 (patch)
tree67ca4c3efd274076af1fc5b49f263abfb735a1f0 /roundcubemail/program/steps
parent2bfc9ba272040e6c0cf0c557963202fbe7bbbf66 (diff)
#1485110
git-svn-id: https://svn.roundcube.net/trunk@1494 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps')
-rw-r--r--roundcubemail/program/steps/mail/func.inc6
1 files changed, 5 insertions, 1 deletions
diff --git a/roundcubemail/program/steps/mail/func.inc b/roundcubemail/program/steps/mail/func.inc
index f4b18411e..718461ec2 100644
--- a/roundcubemail/program/steps/mail/func.inc
+++ b/roundcubemail/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(