Skip to content

Commit 6db4b97

Browse files
committed
Merge branch 'PHP-8.0'
* PHP-8.0: Fix return value of xml_parse(_into_struct) for recursive parsing
2 parents 0f1bf4b + 15e5cf8 commit 6db4b97

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

ext/xml/tests/bug73135.phpt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ HERE;
2121
xml_parse($parser, $xml);
2222
?>
2323
--EXPECTF--
24-
Warning: xml_parse(): Parser must not be called recursively in %s%ebug73135.php on line %d
25-
26-
Warning: xml_parse(): Parser must not be called recursively in %s%ebug73135.php on line %d
27-
28-
Warning: xml_parse(): Unable to call handler ahihi() in %s%ebug73135.php on line %d
29-
30-
Warning: xml_parse(): Unable to call handler ahihi() in %s%ebug73135.php on line %d
24+
Fatal error: Uncaught Error: Parser must not be called recursively in %s:%d
25+
Stack trace:
26+
%a

ext/xml/xml.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,8 +1251,8 @@ PHP_FUNCTION(xml_parse)
12511251

12521252
parser = Z_XMLPARSER_P(pind);
12531253
if (parser->isparsing) {
1254-
php_error_docref(NULL, E_WARNING, "Parser must not be called recursively");
1255-
RETURN_FALSE;
1254+
zend_throw_error(NULL, "Parser must not be called recursively");
1255+
RETURN_THROWS();
12561256
}
12571257
parser->isparsing = 1;
12581258
ret = XML_Parse(parser->parser, (XML_Char*)data, data_len, isFinal);

0 commit comments

Comments
 (0)