Skip to content

Commit 9c9dc5e

Browse files
committed
Stop relying on the sax2 flag directly
Setting this directly will become deprecated in libxml2 2.14.
1 parent a0e8d07 commit 9c9dc5e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ext/xml/compat.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,9 @@ XML_ParserCreate_MM(const XML_Char *encoding, const XML_Memory_Handling_Suite *m
476476
parser->parser->replaceEntities = 1;
477477
parser->parser->wellFormed = 0;
478478
if (sep != NULL) {
479+
/* Note: sax2 flag will be set due to the magic number in `initialized` in php_xml_compat_handlers */
480+
ZEND_ASSERT(parser->parser->sax->initialized == XML_SAX2_MAGIC);
479481
parser->use_namespace = 1;
480-
parser->parser->sax2 = 1;
481482
parser->_ns_separator = xmlStrdup(sep);
482483
} else {
483484
/* Reset flag as XML_SAX2_MAGIC is needed for xmlCreatePushParserCtxt

0 commit comments

Comments
 (0)