]> granicus.if.org Git - php/commitdiff
Fixed bug #31139 (XML Parser Functions seem to drop & when parsing)
authorRob Richards <rrichards@php.net>
Fri, 17 Dec 2004 12:20:50 +0000 (12:20 +0000)
committerRob Richards <rrichards@php.net>
Fri, 17 Dec 2004 12:20:50 +0000 (12:20 +0000)
ext/xml/compat.c

index e0d7f08bd70e5d1c049f345aaa8ed3bfcfc77f54..2b877e1ecb130fcd5dcbe33d58cec45266514eb0 100644 (file)
@@ -280,7 +280,8 @@ _get_entity(void *user, const xmlChar *name)
 
                if (ret == NULL || (parser->parser->instate != XML_PARSER_ENTITY_VALUE && parser->parser->instate != XML_PARSER_ATTRIBUTE_VALUE)) {
                        if (ret == NULL || ret->etype == XML_INTERNAL_GENERAL_ENTITY || ret->etype == XML_INTERNAL_PARAMETER_ENTITY || ret->etype == XML_INTERNAL_PREDEFINED_ENTITY) {
-                               if (parser->h_default) {
+                               /* Predefined entities will expand unless no cdata handler is present */
+                               if (parser->h_default && ! (ret && ret->etype == XML_INTERNAL_PREDEFINED_ENTITY && parser->h_cdata)) {
                                        xmlChar *entity;
                                        int      len;