Fix argument type of simplexml_import_dom (#13170)

It needs to be "object".
This is because first- and third-party extension can register custom
node types using `php_libxml_register_export`. So we don't know upfront
what types can be expected.

This also changes the error to a TypeError everywhere.
This commit is contained in:
Niels Dossche 2024-01-18 20:28:01 +01:00 committed by GitHub
parent 8cc472d5d0
commit 4bd63568fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 12 additions and 7 deletions

View file

@ -147,7 +147,7 @@ PHP_METHOD(XSLTProcessor, importStylesheet)
doc = nodep->doc;
}
if (doc == NULL) {
zend_argument_value_error(1, "must be a valid XML node");
zend_argument_type_error(1, "must be a valid XML node");
RETURN_THROWS();
}
@ -232,7 +232,7 @@ static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStyl
}
if (doc == NULL) {
zend_argument_value_error(1, "must be a valid XML node");
zend_argument_type_error(1, "must be a valid XML node");
return NULL;
}