Changeset a80b7d4 in github


Ignore:
Timestamp:
Jul 30, 2009 10:57:53 PM (4 years ago)
Author:
svncommit <devs@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
5f8d31f9
Parents:
03a63a4
Message:

better solution for HTML washing encoding issue

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    r03a63a4 ra80b7d4  
    22=========================== 
    33 
     4- Fix HTML washing to respect character encoding 
    45- Fix endless loop in iil_C_Login() with Courier IMAP (#1486010) 
    56- Fix #messagemenu display on IE (#1486006) 
     
    78- Fix charset names with X- prefix handling 
    89- Fix displaying of HTML messages with unknown/malformed tags (#1486003) 
    9 - Fix HTML washing of non-UTF8 messages 
    1010 
    1111RELEASE 0.3-RC1 
  • program/steps/mail/func.inc

    rdaa3f72 ra80b7d4  
    686686  $html = preg_replace_callback('/(<[\/!]*)([^ >]+)/', 'rcmail_html_tag_callback', $html); 
    687687 
    688   // charset was converted to UTF-8 in rcube_imap::get_message_part() -> change charset specification in HTML accordingly 
     688  // charset was converted to UTF-8 in rcube_imap::get_message_part(), 
     689  // change charset specification in HTML accordingly 
    689690  $charset_pattern = '/(\s+content=[\'"]?\w+\/\w+;\s*charset)=([a-z0-9-_]+)/i'; 
    690691  if (preg_match($charset_pattern, $html)) { 
    691692    $html = preg_replace($charset_pattern, '\\1='.RCMAIL_CHARSET, $html); 
    692   } else { 
    693     // add head for malformed messages, washtml cannot work without that 
    694     if (!preg_match('/<head[^>]*>(.*)<\/head>/Uims', $html)) 
    695       $html = '<head></head>'. $html; 
    696     $html = substr_replace($html, '<meta http-equiv="content-type" content="text/html; charset='.RCMAIL_CHARSET.'" />', intval(stripos($html, '<head>')+6), 0); 
    697   } 
    698      
     693  } 
     694  // add head for malformed messages, washtml cannot work without that 
     695  if (!preg_match('/<head[^>]*>(.*)<\/head>/Uims', $html)) 
     696    $html = '<head></head>'. $html; 
     697  $html = substr_replace($html, '<meta http-equiv="Content-Type" content="text/html; charset='.RCMAIL_CHARSET.'" />', intval(stripos($html, '<head>')+6), 0); 
     698 
    699699  // turn relative into absolute urls 
    700700  $html = rcmail_resolve_base($html); 
Note: See TracChangeset for help on using the changeset viewer.