|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-09-04 17:29 UTC] phpbugs at colin dot guthr dot ie
Description: ------------ With libxml2 2.7.1, When using the expat type xml parsing routines in PHP, the characater data seems to silently drop any encoded text e.g. > < and friends. Please see Mandriva bug for details: https://qa.mandriva.com/show_bug.cgi?id=43486 And also please note the thread on the libxml mailing list: http://thread.gmane.org/gmane.comp.gnome.lib.xml.general/14610 And most notably the reply to the above thread: <quote> Can you report this as a PHP bug? It looks like some really old hack code in the PHP extension in order to mimic some specific expat functionality. The behavior change you see though resulting from a code changes in libxml2 is really due to the hackish code in the extension doing things it wasnt meant to be doing. </quote> Reproduce code: --------------- Please see this code: https://qa.mandriva.com/attachment.cgi?id=10757 Expected result: ---------------- < foo > wibble < /foo > Actual result: -------------- foo wibble /foo PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 20 20:00:01 2025 UTC |
just tried libxml2-2.7.2 and 5.2.6-pl7-gentoo and it is still broken: Example PHP code: <? $data="<?xml version = '1.0' encoding = 'UTF-8'?> <rss version=\"2.0\" > <channel> <item> <description><a href="http://www.google.com">Google</a></description> </item> </channel> </rss> "; $parser = xml_parser_create('UTF-8'); xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); xml_parse_into_struct($parser, $data, $vals, $index); xml_parser_free($parser); echo "<pre>"; echo "<b>Original XML:</b><br>".htmlentities($data); echo "<br><br><b>Parsed struct:</b><br>"; print_r($vals); ?> .. parsed result is "a href=http://www.google.com>Google/a>"