Changeset f4bf206 in github


Ignore:
Timestamp:
Aug 6, 2009 12:00:01 PM (4 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
10d0e3e
Parents:
00e57d1
Message:
  • fix charset modification in html messages (#1486031)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • program/steps/mail/func.inc

    r269fb82 rf4bf206  
    690690  // charset was converted to UTF-8 in rcube_imap::get_message_part(), 
    691691  // -> change charset specification in HTML accordingly 
    692   $charset_pattern = '(content=[\'"]?\w+\/\w+;\s*charset)=([a-z0-9-_]+)'; 
    693   if (preg_match("/<meta\s+[^>]*$charset_pattern/Ui", $html)) { 
    694     $html = preg_replace("/\s+$charset_pattern/i", '\\1='.RCMAIL_CHARSET, $html); 
     692  $charset_pattern = '(<meta\s+[^>]*)(content=[\'"]?\w+\/\w+;\s*charset)=([a-z0-9-_]+)'; 
     693  if (preg_match("/$charset_pattern/Ui", $html)) { 
     694    $html = preg_replace("/$charset_pattern/i", '\\1\\2='.RCMAIL_CHARSET, $html); 
    695695  } 
    696696  else { 
     
    700700    $html = substr_replace($html, '<meta http-equiv="Content-Type" content="text/html; charset='.RCMAIL_CHARSET.'" />', intval(stripos($html, '<head>')+6), 0); 
    701701  } 
    702    
    703702  // turn relative into absolute urls 
    704703  $html = rcmail_resolve_base($html); 
     
    721720    $wash_opts['html_attribs'] = array('rel','type'); 
    722721  } 
     722console($html);   
    723723     
    724724  $washer = new washtml($wash_opts); 
Note: See TracChangeset for help on using the changeset viewer.