X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Fincludes%2Fhtml_entity_decode_php4.php;h=df1c75559c9e79a3110709da36573e32af1c3b12;hb=43ad91751a494b2572eb64441248aa3a87f0141e;hp=f5c21d8bfb5596b337ffa00b939bd25ef873962d;hpb=5b8f4c4b4aa8cf996bc071f116bfce1273200fa2;p=fa-stable.git diff --git a/reporting/includes/html_entity_decode_php4.php b/reporting/includes/html_entity_decode_php4.php index f5c21d8b..df1c7555 100644 --- a/reporting/includes/html_entity_decode_php4.php +++ b/reporting/includes/html_entity_decode_php4.php @@ -333,8 +333,9 @@ function html_entity_decode_php4($text_to_convert) { ); $return_text = strtr($text_to_convert, $htmlentities_table); - if (version_compare(PHP_VERSION, '5.3.0') >= 0) // 07.11.2014, from php 5.3.0 fixed deprecated preg_replace with the /e flag. Joe. - { + // 07.11.2014, from php 5.3.0 fixed deprecated preg_replace with the /e flag. Joe + if (version_compare(PHP_VERSION, '5.3.0') >= 0 && function_exists("preg_replace_callback")) + { $return_text = preg_replace_callback('~&#x([0-9a-f]+);~i', function ($m){ return chr(hexdec($m[1]));}, $return_text); $return_text = preg_replace_callback('~&#([0-9]+);~', function ($m){ return chr($m[1]);}, $return_text); }