mirror of
https://github.com/php/php-src.git
synced 2026-04-27 10:16:41 +02:00
- Fixed a typo in rev #304208 (24 instead of 34/'"').
- Improved the test bug53021.phpt to reflect other fixes in rev #304208. - Updated NEWS to reflect other fixes in rev #304208.
This commit is contained in:
@@ -26,7 +26,10 @@
|
||||
- Fixed inconsistent backlog default value (-1) in FPM on many systems. (fat)
|
||||
|
||||
- Fixed bug #53021 (In html_entity_decode, failure to convert numeric entities
|
||||
with ENT_NOQUOTES and ISO-8859-1) (Gustavo).
|
||||
with ENT_NOQUOTES and ISO-8859-1). Fixed and extended the fix of ENT_NOQUOTES
|
||||
in html_entity_decode that had introduced the bug (rev #185591) to other
|
||||
encodings. Additionaly, html_entity_decode() now doesn't decode " if
|
||||
ENT_NOQUOTES is given. (Gustavo)
|
||||
- Fixed bug #52981 (Unicode casing table was out-of-date. Updated with
|
||||
UnicodeData-6.0.0d7.txt and included the source of the generator program with
|
||||
the distribution) (Gustavo).
|
||||
|
||||
+2
-2
@@ -1020,8 +1020,8 @@ PHPAPI char *php_unescape_html_entities(unsigned char *old, int oldlen, int *new
|
||||
code = strtol(p + 2, &next, 10);
|
||||
}
|
||||
|
||||
if (code == 39 && !(quote_style & ENT_HTML_QUOTE_SINGLE) ||
|
||||
code == 24 && !(quote_style & ENT_HTML_QUOTE_DOUBLE)) {
|
||||
if (code == '\'' && !(quote_style & ENT_HTML_QUOTE_SINGLE) ||
|
||||
code == '"' && !(quote_style & ENT_HTML_QUOTE_DOUBLE)) {
|
||||
invalid_code = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,32 @@ Bug #53021 (Failure to convert numeric entities with ENT_NOQUOTES and ISO-8859-1
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(unpack("H*",html_entity_decode("é", ENT_QUOTES, "ISO-8859-1")));
|
||||
echo "double quotes variations:", "\n";
|
||||
echo html_entity_decode(""", ENT_NOQUOTES, 'UTF-8'), "\n";
|
||||
echo html_entity_decode(""", ENT_NOQUOTES, 'UTF-8'), "\n";
|
||||
echo html_entity_decode(""", ENT_QUOTES, 'UTF-8'), "\n";
|
||||
echo html_entity_decode(""", ENT_QUOTES, 'UTF-8'), "\n";
|
||||
echo html_entity_decode(""", ENT_COMPAT, 'UTF-8'), "\n";
|
||||
echo html_entity_decode(""", ENT_COMPAT, 'UTF-8'), "\n";
|
||||
|
||||
echo "\nsingle quotes variations:", "\n";
|
||||
echo html_entity_decode("'", ENT_NOQUOTES, 'UTF-8'), "\n";
|
||||
echo html_entity_decode("'", ENT_QUOTES, 'UTF-8'), "\n";
|
||||
echo html_entity_decode("'", ENT_COMPAT, 'UTF-8'), "\n";
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[1]=>
|
||||
string(2) "e9"
|
||||
}
|
||||
double quotes variations:
|
||||
"
|
||||
"
|
||||
"
|
||||
"
|
||||
"
|
||||
"
|
||||
|
||||
single quotes variations:
|
||||
'
|
||||
'
|
||||
'
|
||||
|
||||
Reference in New Issue
Block a user