Changeset 2822 in subversion for trunk/roundcubemail/program/steps/mail/func.inc
- Timestamp:
- Jul 31, 2009 5:07:54 AM (4 years ago)
- File:
-
- 1 edited
-
trunk/roundcubemail/program/steps/mail/func.inc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/steps/mail/func.inc
r2819 r2822 94 94 if ($CONFIG['skip_deleted']) 95 95 $OUTPUT->set_env('skip_deleted', true); 96 if ($CONFIG['display_next']) 97 $OUTPUT->set_env('display_next', true); 96 98 97 99 if ($CONFIG['trash_mbox']) … … 687 689 688 690 // charset was converted to UTF-8 in rcube_imap::get_message_part(), 689 // -> change charset specification in HTML accordingly 690 $charset_pattern = '(content=[\'"]?\w+\/\w+;\s*charset)=([a-z0-9-_]+)'; 691 if (preg_match("/<meta\s+[^>]*$charset_pattern/Ui", $html)) { 692 $html = preg_replace("/\s+$charset_pattern/i", '\\1='.RCMAIL_CHARSET, $html); 693 } 694 else { 695 // add meta content-type to malformed messages, washtml cannot work without that 696 if (!preg_match('/<head[^>]*>(.*)<\/head>/Uims', $html)) 697 $html = '<head></head>'. $html; 698 $html = substr_replace($html, '<meta http-equiv="Content-Type" content="text/html; charset='.RCMAIL_CHARSET.'" />', intval(stripos($html, '<head>')+6), 0); 699 } 700 691 // change charset specification in HTML accordingly 692 $charset_pattern = '/(\s+content=[\'"]?\w+\/\w+;\s*charset)=([a-z0-9-_]+)/i'; 693 if (preg_match($charset_pattern, $html)) { 694 $html = preg_replace($charset_pattern, '\\1='.RCMAIL_CHARSET, $html); 695 } 696 // add head for malformed messages, washtml cannot work without that 697 if (!preg_match('/<head[^>]*>(.*)<\/head>/Uims', $html)) 698 $html = '<head></head>'. $html; 699 $html = substr_replace($html, '<meta http-equiv="Content-Type" content="text/html; charset='.RCMAIL_CHARSET.'" />', intval(stripos($html, '<head>')+6), 0); 700 701 701 // turn relative into absolute urls 702 702 $html = rcmail_resolve_base($html);
Note: See TracChangeset
for help on using the changeset viewer.
