From 8ed8ab00228de57f5b73cfb624ca8bdfc812047d Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Wed, 10 Feb 2010 11:14:22 -0700 Subject: [PATCH] This can all be done in one call in PHP 4.3.0+ --- framework/Text_Filter/lib/Horde/Text/Filter/Html2text.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/framework/Text_Filter/lib/Horde/Text/Filter/Html2text.php b/framework/Text_Filter/lib/Horde/Text/Filter/Html2text.php index 8865683f2..bfaf9e47d 100644 --- a/framework/Text_Filter/lib/Horde/Text/Filter/Html2text.php +++ b/framework/Text_Filter/lib/Horde/Text/Filter/Html2text.php @@ -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); -- 2.11.0