Skip to content

Commit a572b10

Browse files
authored
xml: Switch to safe option setting API (#20128)
1 parent 890021e commit a572b10

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ext/xml/compat.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,12 @@ XML_ParserCreate_MM(const XML_Char *encoding, const XML_Memory_Handling_Suite *m
452452
return NULL;
453453
}
454454

455+
#if LIBXML_VERSION >= 21300
456+
xmlCtxtSetOptions(parser->parser, XML_PARSE_OLDSAX | XML_PARSE_NOENT);
457+
#else
455458
php_libxml_sanitize_parse_ctxt_options(parser->parser);
456459
xmlCtxtUseOptions(parser->parser, XML_PARSE_OLDSAX | XML_PARSE_NOENT);
460+
#endif
457461

458462
parser->parser->wellFormed = 0;
459463
if (sep != NULL) {

0 commit comments

Comments
 (0)