Changeset 5f8686e in github


Ignore:
Timestamp:
Jun 16, 2008 5:53:33 AM (5 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
ccd944e
Parents:
45469db
Message:

#1484423: add <head> for malformed messages, washtml cannot work without that

File:
1 edited

Legend:

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

    r166b615 r5f8686e  
    539539    if(preg_match('/(\s+content=[\'"]\w+\/\w+;\s+charset)=([a-z0-9-]+)/i', $html))  
    540540      $html = preg_replace('/(\s+content=[\'"]\w+\/\w+;\s+charset)=([a-z0-9-]+)/i', '\\1='.RCMAIL_CHARSET, $html);  
    541     else  
     541    else { 
     542      // add <head> for malformed messages, washtml cannot work without that 
     543      if (!preg_match('/<head>(.*)<\/head>/m', $html)) 
     544        $html = '<head></head>' . $html; 
    542545      $html = substr_replace($html, '<meta http-equiv="Content-Type" content="text/html; charset='.RCMAIL_CHARSET.'" />', intval(stripos($html, '</head>')), 0); 
    543      
     546    } 
     547 
    544548    // clean HTML with washhtml by Frederic Motte 
    545549    $body = washtml::wash($html, array( 
     
    701705  { 
    702706  global $CONFIG, $OUTPUT, $MESSAGE, $IMAP, $REMOTE_OBJECTS; 
    703    
     707 
    704708  if (!is_array($MESSAGE->parts) && empty($MESSAGE->body)) 
    705709    return ''; 
     
    732736 
    733737        $body = rcmail_print_body($part, $safe_mode, !$CONFIG['prefer_html']); 
    734          
     738 
    735739        if ($part->ctype_secondary == 'html') 
    736740          $out .= html::div('message-htmlpart', rcmail_html4inline($body, $attrib['id'])); 
Note: See TracChangeset for help on using the changeset viewer.