]> granicus.if.org Git - php/commitdiff
- Fixed a typo in rev #304208 (24 instead of 34/'"').
authorGustavo André dos Santos Lopes <cataphract@php.net>
Fri, 8 Oct 2010 17:27:19 +0000 (17:27 +0000)
committerGustavo André dos Santos Lopes <cataphract@php.net>
Fri, 8 Oct 2010 17:27:19 +0000 (17:27 +0000)
- Improved the test bug53021.phpt to reflect other fixes in rev #304208.
- Updated NEWS to reflect other fixes in rev #304208.

ext/standard/html.c
ext/standard/tests/strings/bug53021.phpt

index 900cb3910f221bb43960b861098d470ffa89df10..7a14f6b0add9098e99871fc9c79cfc2b8d1ad970 100644 (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;
                                        }
 
index 6f290096e4d5038489edfd5ff468d3fc3c68d077..4a8fbe4f760556b74adda41f952099e44fc8c74c 100644 (file)
@@ -3,8 +3,32 @@ Bug #53021 (Failure to convert numeric entities with ENT_NOQUOTES and ISO-8859-1
 --FILE--\r
 <?php\r
 var_dump(unpack("H*",html_entity_decode("&#233;", ENT_QUOTES, "ISO-8859-1")));\r
+echo "double quotes variations:", "\n";\r
+echo html_entity_decode("&quot;", ENT_NOQUOTES, 'UTF-8'), "\n";\r
+echo html_entity_decode("&#34;", ENT_NOQUOTES, 'UTF-8'), "\n";\r
+echo html_entity_decode("&quot;", ENT_QUOTES, 'UTF-8'), "\n";\r
+echo html_entity_decode("&#34;", ENT_QUOTES, 'UTF-8'), "\n";\r
+echo html_entity_decode("&quot;", ENT_COMPAT, 'UTF-8'), "\n";\r
+echo html_entity_decode("&#34;", ENT_COMPAT, 'UTF-8'), "\n";\r
+\r
+echo "\nsingle quotes variations:", "\n";\r
+echo html_entity_decode("&#39;", ENT_NOQUOTES, 'UTF-8'), "\n";\r
+echo html_entity_decode("&#39;", ENT_QUOTES, 'UTF-8'), "\n";\r
+echo html_entity_decode("&#39;", ENT_COMPAT, 'UTF-8'), "\n";\r
 --EXPECT--\r
 array(1) {\r
   [1]=>\r
   string(2) "e9"\r
 }\r
+double quotes variations:\r
+&quot;\r
+&#34;\r
+"\r
+"\r
+"\r
+"\r
+\r
+single quotes variations:\r
+&#39;\r
+'\r
+&#39;\r