Changeset 2823 in subversion


Ignore:
Timestamp:
Jul 31, 2009 5:13:11 AM (4 years ago)
Author:
alec
Message:
  • revert r2819 commit removed in last commit
File:
1 edited

Legend:

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

    r2822 r2823  
    689689 
    690690  // charset was converted to UTF-8 in rcube_imap::get_message_part(), 
    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  
     691  // -> 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); 
     695  } 
     696  else { 
     697    // add meta content-type to malformed messages, washtml cannot work without that 
     698    if (!preg_match('/<head[^>]*>(.*)<\/head>/Uims', $html)) 
     699      $html = '<head></head>'. $html; 
     700    $html = substr_replace($html, '<meta http-equiv="Content-Type" content="text/html; charset='.RCMAIL_CHARSET.'" />', intval(stripos($html, '<head>')+6), 0); 
     701  } 
     702   
    701703  // turn relative into absolute urls 
    702704  $html = rcmail_resolve_base($html); 
Note: See TracChangeset for help on using the changeset viewer.