Req #30875 [Ana->Ver]: xml_parse_into_struct() does not resolve entities in element content
| From: | cmb@php.net | Date: | Wed, 29 Jun 2016 18:41:00 +0000 |
| Subject: | Req #30875 [Ana->Ver]: xml_parse_into_struct() does not resolve entities in element content | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-201919@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=30875&edit=1
ID: 30875
Updated by: cmb@php.net
Reported by: joern_h at gmx dot net
Summary: xml_parse_into_struct() does not resolve entities in
element content
-Status: Analyzed
+Status: Verified
Type: Feature/Change Request
Package: XML related
Operating System: *
PHP Version: 4CVS, 5CVS (2005-02-03)
Block user comment: N
Private report: N
New Comment:
> When using xml_parse_into_struct, entities from the internal dtd
> are not resolved in element content. Entities in attribute
> values are resolved properly.
Indeed, see <https://3v4l.org/8cgbf>. In my opinion, this
inconsistency is a bug.
Previous Comments:
------------------------------------------------------------------------
[2005-02-16 07:35:57] sniper@php.net
After some investigating of the issue: ext/xml just misses this functionality. No bug but feature
request -> reclassified.
------------------------------------------------------------------------
[2005-02-03 14:59:37] joern_h at gmx dot net
This bug still occurs with current PHP4 (Feb 3 2005 06:13:06) and PHP5 (Feb 3 2005 12:17:00)
snapshots.
------------------------------------------------------------------------
[2005-02-03 04:41:34] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2004-11-24 00:11:27] joern_h at gmx dot net
Description:
------------
When using xml_parse_into_struct, entities from the internal dtd are not resolved in element
content. Entities in attribute values are resolved properly. This bug is present in PHP 4.3.8 and
PHP5 (cvs from 2004-11-22).
Reproduce code:
---------------
<?php
$xml = <<<HERE
<!DOCTYPE test [
<!ENTITY test "test">
]>
<test>&test;</test>
HERE;
$parser =& xml_parser_create();
xml_parse_into_struct($parser, $xml, $vals, $idx);
print_r($vals);
xml_parser_free($parser);
?>
Expected result:
----------------
Array
(
[0] => Array
(
[tag] => TEST
[type] => complete
[level] => 1
[value] => test
)
)
Actual result:
--------------
Array
(
[0] => Array
(
[tag] => TEST
[type] => complete
[level] => 1
)
)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=30875&edit=1