|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-11-24 23:50 UTC] bugs dot php dot net at nanonanonano dot net
[2016-12-30 23:19 UTC] cmb@php.net
-Package: Feature/Change Request
+Package: XML related
[2018-03-14 14:24 UTC] cmb@php.net
-Status: Open
+Status: Duplicate
-Assigned To:
+Assigned To: cmb
[2018-03-14 14:24 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 22:00:01 2025 UTC |
Description: ------------ When called on an XML document that contains defined entities, xml_parse_into_struct silently drops the entities from the parsed output. (If the entity is undefined, it returns an error) Reproduce code: --------------- <?php $data = implode ("", file('entityexample.xml')); $parser = xml_parser_create(); xml_parser_set_option ($parser,XML_OPTION_CASE_FOLDING,0); xml_parser_set_option ($parser,XML_OPTION_SKIP_WHITE,1); xml_parse_into_struct ($parser,$data,$values,$tags); xml_parser_free ($parser); #echo "VALS\n"; print_r($values); #echo "TAGS\n"; print_r($tags); echo $values[2]['value']."\n"; ?> ---------- entityexample.xml -------------- <?xml version='1.0'?> <!DOCTYPE test [ <!ENTITY times "FOO BAR"> ]> <test> <item> <name>One × two</name> </item> </test> Expected result: ---------------- The entity should either be not replaced: One × two or it should be correctly replaced: One FOO BAR two Actual result: -------------- The entity is silently dropped from the XML stream: One two