Changeset 2064 in subversion
- Timestamp:
- Nov 19, 2008 2:32:40 AM (5 years ago)
- File:
-
- 1 edited
-
trunk/roundcubemail/program/steps/mail/func.inc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/steps/mail/func.inc
r2051 r2064 598 598 // special replacements (not properly handled by washtml class) 599 599 $html_search = array( 600 '/(<\/nobr>)(\s+)(<nobr>)/i', // space(s) between <NOBR> 601 '/(<[\/]*st1:[^>]+>)/i', // Microsoft's Smart Tags <ST1> 602 '/<title>.*<\/title>/i', // PHP bug #32547 workaround: remove title tag 603 '/<html[^>]*>/im', // malformed html: remove html tags (#1485139) 604 '/<\/html>/i', // malformed html: remove html tags (#1485139) 600 '/(<\/nobr>)(\s+)(<nobr>)/i', // space(s) between <NOBR> 601 '/(<[\/]*st1:[^>]+>)/i', // Microsoft's Smart Tags <ST1> 602 '/<title>.*<\/title>/i', // PHP bug #32547 workaround: remove title tag 603 '/<html[^>]*>/im', // malformed html: remove html tags (#1485139) 604 '/<\/html>/i', // malformed html: remove html tags (#1485139) 605 '/^[\xFE\xFF\xBB\xBF\x00]+((?:<\!doctype|\<html))/im', // remove byte-order mark (only outlook?) 605 606 ); 606 607 $html_replace = array( 607 '\\1'.' '.'\\3', 608 '', 609 '', 610 '', 611 '', 608 '\\1'.' '.'\\3', 609 '', 610 '', 611 '', 612 '\\1', 613 '', 612 614 ); 613 615 $html = preg_replace($html_search, $html_replace, $html); 614 616 615 617 // charset was converted to UTF-8 in rcube_imap::get_message_part() -> change charset specification in HTML accordingly 616 if (preg_match('/(\s+content=[\'"]\w+\/\w+;\s*charset)=([a-z0-9-_]+)/i', $html)) 617 $html = preg_replace('/(\s+content=[\'"]\w+\/\w+;\s*charset)=([a-z0-9-_]+)/i', '\\1='.RCMAIL_CHARSET, $html); 618 $charset_pattern = '/(\s+content=[\'"]?\w+\/\w+;\s*charset)=([a-z0-9-_]+)/i'; 619 if (preg_match($charset_pattern, $html)) { 620 $html = preg_replace($charset_pattern, '\\1='.RCMAIL_CHARSET, $html); 621 } 618 622 else { 619 623 // add head for malformed messages, washtml cannot work without that
Note: See TracChangeset
for help on using the changeset viewer.
