Commit a2dc4e9ff26 for php.net
commit a2dc4e9ff260cd47f8b8b7abe7b555f2b9ff3b2f
Author: Weilin Du <weilindu@php.net>
Date: Thu Aug 20 01:50:34 2026 +0800
ext/dom: Fix INUSE_ATTRIBUTE_ERR message (#23381)
diff --git a/NEWS b/NEWS
index 3029480c18b..1569f2e064d 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,8 @@ PHP NEWS
2GB on some platforms, e.g. Windows. (Sjoerd Langkemper)
- DOM:
+ . Fixed a typo in the DOMException message for INUSE_ATTRIBUTE_ERR.
+ (Weilin Du)
. Fixed bug GH-22624 (use-after-free via DOMNameSpaceNode after
DOMDocument::xinclude()). (David Carlier)
. Fixed a use-after-free when cloning a DOMNameSpaceNode after
diff --git a/ext/dom/domexception.c b/ext/dom/domexception.c
index a7bea009dab..7d9cc751e27 100644
--- a/ext/dom/domexception.c
+++ b/ext/dom/domexception.c
@@ -73,7 +73,7 @@ void php_dom_throw_error(dom_exception_code error_code, bool strict_error)
error_message = "Not Supported Error";
break;
case INUSE_ATTRIBUTE_ERR:
- error_message = "Inuse Attribute Error";
+ error_message = "In Use Attribute Error";
break;
case INVALID_STATE_ERR:
error_message = "Invalid State Error";
diff --git a/ext/dom/tests/modern/spec/Element_setAttributeNode_inuse.phpt b/ext/dom/tests/modern/spec/Element_setAttributeNode_inuse.phpt
index ddbfbde7e61..f6509c07a19 100644
--- a/ext/dom/tests/modern/spec/Element_setAttributeNode_inuse.phpt
+++ b/ext/dom/tests/modern/spec/Element_setAttributeNode_inuse.phpt
@@ -20,5 +20,5 @@
?>
--EXPECT--
-Inuse Attribute Error
+In Use Attribute Error
<container my-attribute="1"><element></element></container>