Recently, I received a message with 6 lines of text out of 10 missing. When I click the "Download this as a file", the message displayed entirely. I'm using PHP 5.4.2 with a recent snapshot v.1.5.2. While investigation, I realized that the htmlspecialchars function is responsible for deleting the information when displaying the message. This is due to the fact that, as per the PHP doc, the charset parameter "Defines encoding used in conversion. If omitted, the default value for this argument is ISO-8859-1 in versions of PHP prior to 5.4.0, and UTF-8 from PHP 5.4.0 onwards."
I fixed it by modifying the charset_decode function in include/languages.php lines 219 - 220 to the following in order to reflect the default parameters in earlier versions:
if ( ! $force_decode && $charset == strtolower($default_charset) )
return ($save_html ? $string : htmlspecialchars($string,ENT_COMPAT | ENT_HTML401,'ISO-8859-1'));
I think this should be better documented or fixed, a cleaner way.
Log in to post a comment.