Changeset 300fc65 in github


Ignore:
Timestamp:
Nov 20, 2008 5:29:34 AM (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:
73ba7ca
Parents:
322b79d
Message:
  • Better HTML entities conversion in html2text (#1485519)
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    r322b79d r300fc65  
    66- Fix handling of some malformed messages (#1484438) 
    77- Speed up raw message body handling 
     8- Better HTML entities conversion in html2text (#1485519) 
    89 
    9102008/11/15 (alec) 
  • bin/html2text.php

    rb685e9e r300fc65  
    2323require INSTALL_PATH.'program/include/iniset.php'; 
    2424 
    25 $converter = new html2text(html_entity_decode($HTTP_RAW_POST_DATA, ENT_COMPAT, 'UTF-8')); 
     25$converter = new html2text($HTTP_RAW_POST_DATA); 
    2626 
    2727header('Content-Type: text/plain; charset=UTF-8'); 
  • program/lib/html2text.php

    rf35a226 r300fc65  
    233233        '-', 
    234234        '*', 
    235         '£', 
     235        '£', 
    236236        'EUR',                                  // Euro sign. € ? 
    237237        '',                                     // Unknown/unhandled entities 
     
    466466        // Convert <PRE> 
    467467        $this->_convert_pre($text); 
    468          
     468 
     469        // Replace known html entities 
     470        $text = html_entity_decode($text, ENT_COMPAT, 'UTF-8'); 
     471 
    469472        // Run our defined search-and-replace 
    470473        $text = preg_replace($this->search, $this->replace, $text); 
  • program/steps/mail/compose.inc

    r3e20c4b r300fc65  
    324324        { 
    325325            $h2t = new html2text($a_signatures[$identity_id]['text'], false, false); 
    326             $plainTextPart = $h2t->get_text(); 
    327             $a_signatures[$identity_id]['plain_text'] = trim(html_entity_decode($plainTextPart, ENT_NOQUOTES, 'UTF-8')); 
     326            $a_signatures[$identity_id]['plain_text'] = trim($h2t->get_text()); 
    328327        } 
    329328      } 
  • program/steps/mail/sendmail.inc

    racff900 r300fc65  
    266266    $plainTextPart = "\r\n";  
    267267    } 
    268   $MAIL_MIME->setTXTBody(html_entity_decode($plainTextPart, ENT_COMPAT, 'utf-8')); 
     268  $MAIL_MIME->setTXTBody($plainTextPart); 
    269269 
    270270  // look for "emoticon" images from TinyMCE and copy into message as attachments 
Note: See TracChangeset for help on using the changeset viewer.