cvs: php-src(PHP_4_3) /ext/standard html.c /ext/standard/tests/strings bug25707.phpt
| From: | Moriyoshi Koizumi | Date: | Thu, 02 Oct 2003 07:00:57 +0000 |
| Subject: | cvs: php-src(PHP_4_3) /ext/standard html.c /ext/standard/tests/strings bug25707.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-23980@lists.php.net to get a copy of this message | ||
moriyoshi Thu Oct 2 03:00:57 2003 EDT
Added files: (Branch: PHP_4_3)
/php-src/ext/standard/tests/strings bug25707.phpt
Modified files:
/php-src/ext/standard html.c
Log:
Fixed bug #25707 (html_entity_decode over-decodes <)
# note: not MFH stuff
Index: php-src/ext/standard/html.c
diff -u php-src/ext/standard/html.c:1.63.2.15 php-src/ext/standard/html.c:1.63.2.16
--- php-src/ext/standard/html.c:1.63.2.15 Thu May 8 11:44:32 2003
+++ php-src/ext/standard/html.c Thu Oct 2 03:00:55 2003
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: html.c,v 1.63.2.15 2003/05/08 15:44:32 moriyoshi Exp $ */
+/* $Id: html.c,v 1.63.2.16 2003/10/02 07:00:55 moriyoshi Exp $ */
/*
* HTML entity resources:
@@ -415,12 +415,12 @@
int entitylen;
int flags;
} basic_entities[] = {
- { '&', "&", 5, 0 },
{ '"', """, 6, ENT_HTML_QUOTE_DOUBLE },
{ '\'', "'", 6, ENT_HTML_QUOTE_SINGLE },
{ '\'', "'", 5, ENT_HTML_QUOTE_SINGLE },
{ '<', "<", 4, 0 },
{ '>', ">", 4, 0 },
+ { '&', "&", 5, 0 }, /* this should come last */
{ 0, NULL, 0, 0 }
};
Index: php-src/ext/standard/tests/strings/bug25707.phpt
+++ php-src/ext/standard/tests/strings/bug25707.phpt
--TEST--
Bug #25707 (html_entity_decode over-decodes &lt;)
--FILE--
<?php
var_dump(html_entity_decode("&lt;", ENT_COMPAT, 'ISO-8859-1'));
var_dump(html_entity_decode("&#38;", ENT_COMPAT, 'ISO-8859-1'));
var_dump(html_entity_decode("&#38;lt;", ENT_COMPAT, 'ISO-8859-1'));
?>
--EXPECT--
string(4) "<"
string(5) "&"
string(8) "&lt;"