summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;