mirror of
https://github.com/php/php-src.git
synced 2024-09-21 09:57:23 +00:00
Fix GH-15910: Assertion failure in ext/dom/element.c
This commit is contained in:
parent
c65e042c0b
commit
55aa5f3ffb
1
NEWS
1
NEWS
@ -5,6 +5,7 @@ PHP NEWS
|
||||
- DOM:
|
||||
. Fix XML serializer errata: xmlns="" serialization should be allowed.
|
||||
(nielsdos)
|
||||
. Fixed bug GH-15910 (Assertion failure in ext/dom/element.c). (nielsdos)
|
||||
|
||||
- MBString:
|
||||
. Fixed bug GH-15824 (mb_detect_encoding(): Argument $encodings contains
|
||||
|
@ -683,7 +683,7 @@ static void dom_element_set_attribute_node_common(INTERNAL_FUNCTION_PARAMETERS,
|
||||
dom_object *intern, *attrobj, *oldobj;
|
||||
|
||||
id = ZEND_THIS;
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &node, dom_get_node_ce(modern)) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &node, dom_get_attr_ce(modern)) == FAILURE) {
|
||||
RETURN_THROWS();
|
||||
}
|
||||
|
||||
|
18
ext/dom/tests/gh15910.phpt
Normal file
18
ext/dom/tests/gh15910.phpt
Normal file
@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
GH-15910 (Assertion failure in ext/dom/element.c)
|
||||
--EXTENSIONS--
|
||||
dom
|
||||
--CREDITS--
|
||||
YuanchengJiang
|
||||
--FILE--
|
||||
<?php
|
||||
$doc = new DOMDocument();
|
||||
$doc->appendChild($doc->createElement('container'));
|
||||
try {
|
||||
$doc->documentElement->setAttributeNodeNS($doc);
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
DOMElement::setAttributeNodeNS(): Argument #1 ($attr) must be of type DOMAttr, DOMDocument given
|
Loading…
Reference in New Issue
Block a user