#1485640: html2text: move html_entity_decode() after preg_replace()
release-0.6
alecpl 16 years ago
parent 0fc97c2833
commit 4e0419b9cb

@ -243,7 +243,6 @@ class Mail_mimePart {
$encoded =& $this->_encoded; $encoded =& $this->_encoded;
if (count($this->_subparts)) { if (count($this->_subparts)) {
srand((double)microtime()*1000000);
$boundary = '=_' . md5(rand() . microtime()); $boundary = '=_' . md5(rand() . microtime());
$this->_headers['Content-Type'] .= ';' . MAIL_MIMEPART_CRLF . "\t" . 'boundary="' . $boundary . '"'; $this->_headers['Content-Type'] .= ';' . MAIL_MIMEPART_CRLF . "\t" . 'boundary="' . $boundary . '"';

@ -468,13 +468,13 @@ class html2text
// Convert <PRE> // Convert <PRE>
$this->_convert_pre($text); $this->_convert_pre($text);
// Replace known html entities
$text = html_entity_decode($text, ENT_COMPAT, 'UTF-8');
// Run our defined search-and-replace // Run our defined search-and-replace
$text = preg_replace($this->search, $this->replace, $text); $text = preg_replace($this->search, $this->replace, $text);
$text = preg_replace_callback($this->callback_search, array('html2text', '_preg_callback'), $text); $text = preg_replace_callback($this->callback_search, array('html2text', '_preg_callback'), $text);
// Replace known html entities
$text = html_entity_decode($text, ENT_COMPAT, 'UTF-8');
// Strip any other HTML tags // Strip any other HTML tags
$text = strip_tags($text, $this->allowed_tags); $text = strip_tags($text, $this->allowed_tags);

Loading…
Cancel
Save