From c8964b9a0819a96e22b75e03403f7d47d9dd4010 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 22 Jul 2023 18:04:49 +0200 Subject: [PATCH] Use xmlSetNsProp when possible to prevent parsing the name The normal xmlSetProp() function parses the name to find the namespace. But we don't care about the namespace in this case. --- ext/dom/element.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/dom/element.c b/ext/dom/element.c index 048c71c9366..b4763bca0da 100644 --- a/ext/dom/element.c +++ b/ext/dom/element.c @@ -174,7 +174,7 @@ static xmlAttrPtr dom_element_reflected_attribute_write(dom_object *obj, zval *n /* Typed property, so it is a string already */ ZEND_ASSERT(Z_TYPE_P(newval) == IS_STRING); - return xmlSetProp(nodep, (const xmlChar *) name, (const xmlChar *) Z_STRVAL_P(newval)); + return xmlSetNsProp(nodep, NULL, (const xmlChar *) name, (const xmlChar *) Z_STRVAL_P(newval)); } /* {{{ className string