From: Rob Richards Date: Fri, 17 Dec 2004 12:20:50 +0000 (+0000) Subject: Fixed bug #31139 (XML Parser Functions seem to drop & when parsing) X-Git-Tag: RELEASE_0_2~506 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b462fc8bd20137ec983a887fec95902bed1161ad;p=php Fixed bug #31139 (XML Parser Functions seem to drop & when parsing) --- diff --git a/ext/xml/compat.c b/ext/xml/compat.c index e0d7f08bd7..2b877e1ecb 100644 --- a/ext/xml/compat.c +++ b/ext/xml/compat.c @@ -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;