libxml2 2.7.1 causes breakage with character data in xml_parse()
| Bug #45996 | libxml2 2.7.1 causes breakage with character data in xml_parse() | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2008-09-04 17:29 UTC | Modified: | 2011-01-04 22:08 UTC |
|
||||||||||
| From: | phpbugs at colin dot guthr dot ie | Assigned: | rrichards (profile) | |||||||||||
| Status: | Closed | Package: | XML related | |||||||||||
| PHP Version: | 5.2.6 | OS: | Mandriva Linux | |||||||||||
| Private report: | No | CVE-ID: | None | |||||||||||
[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
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2008-09-06 15:43 UTC] jani@php.net
[2008-09-09 23:06 UTC] phpbugs at colin dot guthr dot ie
[2008-10-08 09:18 UTC] uraes at hot dot ee
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>"[2008-10-08 09:50 UTC] phpbugs at colin dot guthr dot ie
[2008-10-15 00:04 UTC] mike at kogan dot org
[2008-10-16 02:01 UTC] mike at Kogan dot org
[2008-10-16 14:56 UTC] mike at kogan dot org
[2008-10-17 13:40 UTC] jorton@php.net
[2008-10-17 14:08 UTC] rrichards@php.net
[2008-10-22 11:39 UTC] markus dot gevers at contenit dot de
[2008-10-24 20:47 UTC] sanepit at o2 dot pl
[2008-10-25 18:12 UTC] alykhanii at yahoo dot com
[2008-10-31 14:45 UTC] sunil at truesparrow dot com
[2008-11-03 23:16 UTC] hjthring at lavabit dot com
[2008-11-04 20:35 UTC] rolysatch at hotmail dot com
[2008-11-04 21:00 UTC] rrichards@php.net
[2008-11-05 16:13 UTC] jorton@php.net
[2008-11-05 16:30 UTC] rrichards@php.net
[2008-11-20 22:37 UTC] rcasagraude at interfaces dot fr
[2008-11-21 15:31 UTC] ajay12006 at gmail dot com
[2008-11-21 15:32 UTC] phpbugs at colin dot guthr dot ie
[2008-12-03 17:46 UTC] hoffie at gentoo dot org
[2008-12-07 13:08 UTC] rolysatch at hotmail dot com
[2008-12-14 22:17 UTC] alykhanii at yahoo dot com
[2008-12-17 00:09 UTC] joshua at joshuascott dot net
[2008-12-17 00:49 UTC] scottmac@php.net
[2008-12-17 00:56 UTC] rrichards@php.net
[2008-12-17 15:18 UTC] valli at icsurselva dot ch
[2008-12-28 03:55 UTC] alex at magnet dot ru
[2008-12-28 13:37 UTC] phpbugs at colin dot guthr dot ie
[2008-12-29 17:02 UTC] jeffrey dot roberts at ibsgroup dot org
[2008-12-31 00:56 UTC] mark at mcclusky dot com
[2008-12-31 13:37 UTC] phpbugs at colin dot guthr dot ie
[2008-12-31 14:35 UTC] hougiwro at guerrillamail dot org
[2008-12-31 15:22 UTC] scottmac@php.net
[2009-01-01 19:31 UTC] alex at peoples dot ru
[2009-01-01 20:09 UTC] phpbugs at colin dot guthr dot ie
[2009-01-02 23:03 UTC] geoffers+phpbugs at gmail dot com
[2009-01-03 04:03 UTC] david+phpbugs at midrange dot com
[2009-01-11 12:06 UTC] rrichards@php.net
[2010-04-19 00:05 UTC] nick dot phillips at otago dot ac dot nz
[2010-07-07 23:17 UTC] i_cypher at hotmail dot com
[2011-01-04 19:50 UTC] lwc at mailmetrash dot com
[2011-01-04 20:55 UTC] lwc at mailmetrash dot com
[2011-01-04 21:54 UTC] lwc at mailmetrash dot cm
[2011-01-04 22:08 UTC] rrichards@php.net
[2011-03-24 02:21 UTC] david at moodle dot com