summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Richards <rrichards@php.net>2004-12-17 12:20:50 +0000
committerRob Richards <rrichards@php.net>2004-12-17 12:20:50 +0000
commitb462fc8bd20137ec983a887fec95902bed1161ad (patch)
tree2bd4189b021642762dc227cc024c526a3e63b179
parent3f835d67baab16edffd23153fe5d5e6cb33b4e94 (diff)
downloadphp-git-b462fc8bd20137ec983a887fec95902bed1161ad.tar.gz
Fixed bug #31139 (XML Parser Functions seem to drop &amp; when parsing)
-rw-r--r--ext/xml/compat.c3
1 files changed, 2 insertions, 1 deletions
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;