diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2003-12-05 01:16:16 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2003-12-05 01:16:16 +0000 |
commit | ce0b3dec4c70670449e1add99ab23375087f5dde (patch) | |
tree | ed2a7661583a158eb38fd2e36c431e75de910ea7 /ext | |
parent | 32eb4f78c2f761b1f1c89aa82c057ee62590b10e (diff) | |
download | php-git-ce0b3dec4c70670449e1add99ab23375087f5dde.tar.gz |
Fixed bug #26528 (HTML entities are not being decoded by
xml_parse()/xml_parse_into_struct()).
Diffstat (limited to 'ext')
-rw-r--r-- | ext/xml/compat.c | 1 | ||||
-rw-r--r-- | ext/xml/tests/bug26528.phpt | 27 |
2 files changed, 28 insertions, 0 deletions
diff --git a/ext/xml/compat.c b/ext/xml/compat.c index 6a40be8497..5b878fa269 100644 --- a/ext/xml/compat.c +++ b/ext/xml/compat.c @@ -412,6 +412,7 @@ XML_ParserCreate_MM(const XML_Char *encoding, const XML_Memory_Handling_Suite *m } else { parser->parser->charset = XML_CHAR_ENCODING_NONE; } + parser->parser->replaceEntities=1; if (sep != NULL) { parser->use_namespace = 1; parser->_ns_map = xmlHashCreate(10); diff --git a/ext/xml/tests/bug26528.phpt b/ext/xml/tests/bug26528.phpt new file mode 100644 index 0000000000..2fa015a84d --- /dev/null +++ b/ext/xml/tests/bug26528.phpt @@ -0,0 +1,27 @@ +--TEST-- +Bug #26528 (HTML entities are not being decoded) +--FILE-- +<?php + $sample = "<?xml version=\"1.0\"?><test attr=\"angle<bracket\"/>"; + $parser = xml_parser_create(); + $res = xml_parse_into_struct($parser,$sample,$vals,$index); + xml_parser_free($parser); + var_dump($vals); +?> +--EXPECT-- +array(1) { + [0]=> + array(4) { + ["tag"]=> + string(4) "TEST" + ["type"]=> + string(8) "complete" + ["level"]=> + int(1) + ["attributes"]=> + array(1) { + ["ATTR"]=> + string(13) "angle<bracket" + } + } +} |