File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -375,7 +375,11 @@ _get_entity(void *user, const xmlChar *name)
375
375
if (ret == NULL )
376
376
ret = xmlGetDocEntity (parser -> parser -> myDoc , name );
377
377
378
- if (ret == NULL || (parser -> parser -> instate != XML_PARSER_ENTITY_VALUE && parser -> parser -> instate != XML_PARSER_ATTRIBUTE_VALUE )) {
378
+ /* At least libxml2 >= 2.14 no longer sets these states, so starting with that version the first if is always true. */
379
+ #if LIBXML_VERSION < 21400
380
+ if (ret == NULL || (parser -> parser -> instate != XML_PARSER_ENTITY_VALUE && parser -> parser -> instate != XML_PARSER_ATTRIBUTE_VALUE ))
381
+ #endif
382
+ {
379
383
if (ret == NULL || ret -> etype == XML_INTERNAL_GENERAL_ENTITY || ret -> etype == XML_INTERNAL_PARAMETER_ENTITY || ret -> etype == XML_INTERNAL_PREDEFINED_ENTITY ) {
380
384
/* Predefined entities will expand unless no cdata handler is present */
381
385
if (parser -> h_default && ! (ret && ret -> etype == XML_INTERNAL_PREDEFINED_ENTITY && parser -> h_cdata )) {
You can’t perform that action at this time.
0 commit comments