ID: 32441
Updated by: [EMAIL PROTECTED]
Reported By: joern_h at gmx dot net
-Status: Open
+Status: Bogus
Bug Type: XML related
Operating System: Windows 2000
PHP Version: 5CVS-2005-03-24 (dev)
New Comment:
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same.
Thank you for your interest in PHP.
See bug #27908
Previous Comments:
------------------------------------------------------------------------
[2005-03-24 13:13:31] joern_h at gmx dot net
Description:
------------
When the replacement for an entity contains xml tags or another entity
these do not get parsed by PHP5. Such constructs are used for example
inside the PHP documentation to mark up often used strings like
warnings and section titles. This code works in PHP4.
Reproduce code:
---------------
<?php
error_reporting(E_ALL);
$xml = <<<HERE
<!DOCTYPE test [
<!ENTITY test "<abc>&</abc>">
]>
<test>&test;</test>
HERE;
function startHandler($parser, $name, $attrs) {print("StartHandler
Called\n");}
function endHandler($parser, $name) {print("EndHandler Called\n");}
function characterHandler($parser, $data) {echo "Character: $data\n";}
$parser =& xml_parser_create('');
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, false);
xml_set_element_handler($parser, 'startHandler', 'endHandler');
xml_set_character_data_handler($parser, 'characterHandler');
if (!xml_parse($parser, $xml, true))
echo xml_error_string($parser);
xml_parser_free($parser);
?>
Expected result:
----------------
StartHandler Called
StartHandler Called
Character: &
EndHandler Called
EndHandler Called
Actual result:
--------------
StartHandler Called
Character: <abc>&</abc>
EndHandler Called
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32441&edit=1