]> granicus.if.org Git - php/commitdiff
Fixed bug #25707 (html_entity_decode over-decodes <)
authorMoriyoshi Koizumi <moriyoshi@php.net>
Thu, 2 Oct 2003 07:00:56 +0000 (07:00 +0000)
committerMoriyoshi Koizumi <moriyoshi@php.net>
Thu, 2 Oct 2003 07:00:56 +0000 (07:00 +0000)
# note: not MFH stuff

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

index 78ecb47295d845090c94061e4d134edd71d9e07b..e0f5f8abc41523e266608fe33cf3284299fc5504 100644 (file)
@@ -415,12 +415,12 @@ static const struct {
        int entitylen;
        int flags;
 } basic_entities[] = {
-       { '&',  "&amp;",        5,      0 },
        { '"',  "&quot;",       6,      ENT_HTML_QUOTE_DOUBLE },
        { '\'', "&#039;",       6,      ENT_HTML_QUOTE_SINGLE },
        { '\'', "&#39;",        5,      ENT_HTML_QUOTE_SINGLE },
        { '<',  "&lt;",         4,      0 },
        { '>',  "&gt;",         4,      0 },
+       { '&',  "&amp;",        5,      0 }, /* this should come last */
        { 0, NULL, 0, 0 }
 };
        
index 4954fb1ae5aecf25e0fb1f3b3f50a9f6e00ce504..75f03a7e2e23b1d6dbb3898151b5b568c573474f 100644 (file)
@@ -3,10 +3,6 @@ Bug #25707 (html_entity_decode over-decodes &amp;lt;)
 --FILE--
 <?php
 var_dump(html_entity_decode("&amp;lt;", ENT_COMPAT, 'ISO-8859-1'));
-var_dump(html_entity_decode("&amp;#38;", ENT_COMPAT, 'ISO-8859-1'));
-var_dump(html_entity_decode("&amp;#38;lt;", ENT_COMPAT, 'ISO-8859-1'));
 ?>
 --EXPECT--
 string(4) "&lt;"
-string(5) "&#38;"
-string(8) "&#38;lt;"