From: jmpons at arenamobile dot com Operating system: Fedora Release 8 PHP version: 5.2.6 PHP Bug Type: *XML functions Bug description: xml_parser_into_struct doesn't return correct data
Description: ------------ With php 5.2.6, parsing xml code with html inside, return a bad parsed string... I have checked it with php 5.2.5 and it works fine... Reproduce code: --------------- <?xml version="1.0" encoding="ISO-8859-1"?> <tree> <node>bla bla bla <br/> <a href="http://www.google.com">url</a> blah...</node> </tree> <?php $file = "test.xml"; $data = implode("", file($file)); $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); print_r($values); ?> Expected result: ---------------- Array ( [0] => Array ( [tag] => tree [type] => open [level] => 1 ) [1] => Array ( [tag] => node [type] => complete [level] => 2 [value] => bla bla bla <br/><a href="http://www.google.com">url</a> blah... ) [2] => Array ( [tag] => tree [type] => close [level] => 1 ) ) Actual result: -------------- Array ( [0] => Array ( [tag] => tree [type] => open [level] => 1 ) [1] => Array ( [tag] => node [type] => complete [level] => 2 [value] => bla bla bla br/a href="http://www.google.com"url/a blah... ) [2] => Array ( [tag] => tree [type] => close [level] => 1 ) ) -- Edit bug report at http://bugs.php.net/?id=46432&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46432&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46432&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46432&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=46432&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=46432&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=46432&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=46432&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=46432&r=needscript Try newer version: http://bugs.php.net/fix.php?id=46432&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=46432&r=support Expected behavior: http://bugs.php.net/fix.php?id=46432&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=46432&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=46432&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=46432&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46432&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=46432&r=dst IIS Stability: http://bugs.php.net/fix.php?id=46432&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=46432&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=46432&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=46432&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=46432&r=mysqlcfg