-
Notifications
You must be signed in to change notification settings - Fork 92
Implementation of 'htmlspecialchars' is not complete #69
Comments
And the function should not translate symbol & to & A M P when its not an attribute.
|
Does the behaviour of Phalanger differ from PHP? It appears you are stating that Phalanger escapes |
Right, if you have a small test case in PHP, please try it with Phalanger and legacy PHP first whether it differs. |
code: offical php output: Phalanger output: |
when invoke htmlspecialchars( $string ) twice, the official php and Phalanger get the same result the test results are different. the official php seems like fixed |
Please can you tidy your test case to separate the outputs so that we can see what is output by which part of the test. It is still not clear what you are actually stating is the problem, i.e. which circumstance causes the issue you perceive. As an example, it is not clear what value $double_encode has in your example: is it true, false, empty string, null, ....? |
known little about php, how can i know the $double_encode is ture/false, or empty string or null or someting else? |
I also meet this problem when try wp4.6.1 with Phalanger. 居然是同胞,我也是不懂php,太巧了 |
the htmlspecialchars will not translate any word in this list
"&", """, "'", "<", ">"
but HtmlSpecialCharsEncode does not implements the logic, so if the input contains any words in the list above, the output will be unexpected.
eg. & will be translated to &amp;
found the issue when woking with wordpress 4.6.1
The text was updated successfully, but these errors were encountered: