Opened 13 years ago
Last modified 11 years ago
#8886 confirmed Bug
htmlspecialchars() calls will return an empty string under certain conditions
Reported by: | bugmenot | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Server : PHP | Version: | |
Keywords: | Cc: |
Description ¶
http://php.net/manual/en/function.htmlentities.php
Like htmlspecialchars(), htmlentities() takes an optional third argument encoding which 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. Although this argument is technically optional, you are highly encouraged to specify the correct value for your code.
In case of PHP 5.4 environment htmlspecialchars() will return an empty string when supplied with a text in non-default encoding (UTF-8) and no exact encoding specified in third argument. So you need to implement an ability to pass text encoding name to editor() method somehow.
Change History (6)
comment:2 Changed 13 years ago by
@bugmenot can you give us some test case or example text that cause problems ? This helps us test and resolve this issue faster.
Changed 13 years ago by
Attachment: | test_case.zip added |
---|
comment:3 Changed 13 years ago by
I have attached test_case.zip. This test case fails on PHP 5.4. Please extract archive to CKEditor's _samples/php directory.
comment:4 Changed 13 years ago by
Status: | new → confirmed |
---|
comment:5 Changed 11 years ago by
Keywords: | PHP 5.4 htmlspecialchars encoding removed |
---|
htmlspecialchars() may be called with an empty string as a third argument so it will rely on global default_encoding setting (http://www.php.net/manual/en/ini.core.php#ini.default-charset) which can be set only once by the main application