]> git.donarmstrong.com Git - roundcube.git/blobdiff - bin/html2text.php
Imported Upstream version 0.1~rc2
[roundcube.git] / bin / html2text.php
index e0e2679f7fe4c23d38268fe1bb2ab26b41e86d7b..7f74ac622cfb8532dba063a0ac396068352a64a8 100644 (file)
@@ -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
+?>