This can all be done in one call in PHP 4.3.0+
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 10 Feb 2010 18:14:22 +0000 (11:14 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 11 Feb 2010 08:24:53 +0000 (01:24 -0700)
framework/Text_Filter/lib/Horde/Text/Filter/Html2text.php

index 8865683..bfaf9e4 100644 (file)
@@ -170,9 +170,7 @@ class Horde_Text_Filter_Html2text extends Horde_Text_Filter
         $text = strip_tags($text);
 
         /* Convert HTML entities. */
-        $trans = array_flip(get_html_translation_table(HTML_ENTITIES));
-        $trans = Horde_String::convertCharset($trans, 'ISO-8859-1', $this->_params['charset']);
-        $text = strtr($text, $trans);
+        $text = html_entity_decode($text, ENT_QUOTES, $this->_params['charset']);
 
         /* Bring down number of empty lines to 2 max. */
         $text = preg_replace("/\n[[:space:]]+\n/", "\n\n", $text);