1
0
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:
Gustavo André dos Santos Lopes
2010-10-08 17:27:19 +00:00
parent 485a094334
commit 4e2fd7eeba
3 changed files with 30 additions and 3 deletions
+4 -1
View File
@@ -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
View File
@@ -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;
}
+24
View File
@@ -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("&#233;", ENT_QUOTES, "ISO-8859-1")));
echo "double quotes variations:", "\n";
echo html_entity_decode("&quot;", ENT_NOQUOTES, 'UTF-8'), "\n";
echo html_entity_decode("&#34;", ENT_NOQUOTES, 'UTF-8'), "\n";
echo html_entity_decode("&quot;", ENT_QUOTES, 'UTF-8'), "\n";
echo html_entity_decode("&#34;", ENT_QUOTES, 'UTF-8'), "\n";
echo html_entity_decode("&quot;", ENT_COMPAT, 'UTF-8'), "\n";
echo html_entity_decode("&#34;", ENT_COMPAT, 'UTF-8'), "\n";
echo "\nsingle quotes variations:", "\n";
echo html_entity_decode("&#39;", ENT_NOQUOTES, 'UTF-8'), "\n";
echo html_entity_decode("&#39;", ENT_QUOTES, 'UTF-8'), "\n";
echo html_entity_decode("&#39;", ENT_COMPAT, 'UTF-8'), "\n";
--EXPECT--
array(1) {
[1]=>
string(2) "e9"
}
double quotes variations:
&quot;
&#34;
"
"
"
"
single quotes variations:
&#39;
'
&#39;