diff options
author | svncommit <devs@roundcube.net> | 2007-06-08 23:47:57 +0000 |
---|---|---|
committer | svncommit <devs@roundcube.net> | 2007-06-08 23:47:57 +0000 |
commit | 8094288d237a2503de6f97956b5558b28c4db56b (patch) | |
tree | 8b1b8f1a5740b57a845c650dda301839ae36e522 /bin | |
parent | 570f0bb4a609b04dab58407a642922dfdf715bd5 (diff) |
fixed html2text in editor
Diffstat (limited to 'bin')
-rw-r--r-- | bin/html2text.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bin/html2text.php b/bin/html2text.php index e0e2679f7..7f74ac622 100644 --- a/bin/html2text.php +++ b/bin/html2text.php @@ -8,9 +8,14 @@ $converter = new html2text($htmlText); header('Content-Type: text/plain; charset=UTF-8'); $plaintext = $converter->get_text(); -if (function_exists('html_entity_decode')) +$phpver = explode('.', phpversion()); +$vernum = $phpver[0] . $phpver[1] . $phpver[2]; + +# html_entity_decode doesn't handle UTF character sets in PHP 4.x + +if (($vernum >= 500) && function_exists('html_entity_decode')) print html_entity_decode($plaintext, ENT_COMPAT, 'UTF-8'); else print $plaintext; -?>
\ No newline at end of file +?> |