#45996 [Asn]: libxml2 2.7.1 causes breakage with character data in xml_parse()
From: rrichards@php.net Date: Fri, 17 Oct 2008 14:08:57 +0000 Subject: #45996 [Asn]: libxml2 2.7.1 causes breakage with character data in xml_parse() References: 1 Groups: php.bugs Request: Send a blank email to php-bugs+get-129806@lists.php.net to get a copy of this message
ID: 45996
Updated by: rrichards@php.net
Reported By: phpbugs at colin dot guthr dot ie
Status: Assigned
Bug Type: XML related
Operating System: Mandriva Linux
PHP Version: 5.2.6
Assigned To: rrichards
New Comment:
Changing the flag fixes internally defined entities, but breaks the
rest
of the entity handling.
Previous Comments:
------------------------------------------------------------------------
[2008-10-17 13:40:27] jorton@php.net
So far as I can tell the only problem here is that libxml2 is bailing
in parser.c:xmlParseReference() because the ctxt->wellFormed flag is
cleared. It is set to zero by compat.c, which seems simply wrong;
xmlCreate*ParserContext initialize it to non-zero.
If I apply this patch it works fine:
http://people.apache.org/~jorton/php-5.2.6-xmlwformed.patch
Rob?
------------------------------------------------------------------------
[2008-10-16 14:56:03] mike at kogan dot org
Nevermind we got it - libexpat is in and workaround is fine. Thanks
again and happy coding!
------------------------------------------------------------------------
[2008-10-16 02:01:00] mike at Kogan dot org
Thanks Col - unfortunately after thrashing on this for a day I either
have gotten libexpat built in and it hasn't worked, or my efforts to
build it into Apache2 have not worked. How can I tell once I've rebuilt
apache whether it's in or not? Will it show up on phpinfo? I see
libexpat.so on the system and configured apache --with-expat=builtin and
tried using the expat on the system but I'm not sure if it's actually
getting there. Sorry in advance if this is not the place to ask such a
question but googling libexpat has not been fruitful.
------------------------------------------------------------------------
[2008-10-15 09:02:54] phpbugs at colin dot guthr dot ie
Mike, it's fairly easy to recompile PHP with the libexpat library for
the legacy XML parsing functions while keeping libxml2 for the more
modern ones.
We did that in the Mandriva package for our 2009.0 release after I
reported the bug.
See the SPEC file here:
http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/updates/2009.0/php/current/SPECS/php.spec?revision=291141&view=markup
The particular change that worked around it is here:
http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/updates/2009.0/php/current/SPECS/php.spec?r1=278891&r2=281822
I'm sure you can work out how to get the needed patch that is mentioned
by navigating the webcvs :) You should be able to use this to recompile
the CentOS PHP package accordingly.
Hope this helps.
Col
------------------------------------------------------------------------
[2008-10-15 00:04:01] mike at kogan dot org
I also have run into this - we had some legacy php code on the
xml_parser that was fine on some centos 4 servers with php4 and 5
running apache 1.3. We've been debugging this failure for a day now on
our new centos 5 server running php5 and libxml2 2.7.2, and we confirm
the same problem. The characterHandler is not called for the known
entities so scripts depending on this (rss feed converters etc) emit
flawed html. I agree there's much better ways to parse XML but this is
legacy stuff thats somewhat pervasive and we didn;t choose what these
folks used for their apps.
I'd love to rebuild their server with an older libxml2 but am not sure
how to go backwards without causing some other problem. Customer has
cpanel/whm and all that hooey and I'd rather not create a mess on their
new server.
Hope ya'll fix this soon as it is an issue on the cpanel folks that
have 2.7.2 in their stable branch for centos 5 that is being spread by
their updater.
If someone can give me a pointer that a straightup build and install of
the old release code wont make things worse I'll take a crack at moving
their server back.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/45996
--
Edit this bug report at http://bugs.php.net/?id=45996&edit=1
Thread (54 messages)
- #45996 [Opn]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Opn->Asn]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Asn]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Asn]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Asn]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Asn]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Asn]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Asn]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Asn]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Asn]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Asn]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Asn]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Asn]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Asn]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Asn]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- #45996 [Asn->Csd]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- Bug #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- Bug #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- Bug #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- Bug #45996 [Csd]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- Bug #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- Bug #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- Bug #45996 [Csd]: libxml2 2.7.1 causes breakage with character data in xml_parse()
- Bug #45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()
| « previous | php.bugs (#129806) | next » |
|---|