[php-src] master: ext/dom: Fix INUSE_ATTRIBUTE_ERR message (#23381)
Weilin Du via GitHub <[email protected]>
| Newsgroups | gmane.comp.php.cvs.general |
|---|---|
| Message-ID | <[email protected]> |
Author: Weilin Du (LamentXU123)
Committer: GitHub (web-flow)
Pusher: LamentXU123
Date: 2026-08-20T01:50:34+08:00
Commit: https://github.com/php/php-src/commit/a2dc4e9ff260cd47f8b8b7abe7b555f2b9ff3b2f
Raw diff: https://github.com/php/php-src/commit/a2dc4e9ff260cd47f8b8b7abe7b555f2b9ff3b2f.diff
ext/dom: Fix INUSE_ATTRIBUTE_ERR message (#23381)
Changed paths:
M NEWS
M ext/dom/domexception.c
M ext/dom/tests/modern/spec/Element_setAttributeNode_inuse.phpt
Diff:
diff --git a/NEWS b/NEWS
index 3029480c18b0..1569f2e064d5 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 a7bea009dabc..7d9cc751e275 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 ddbfbde7e616..f6509c07a192 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 @@ echo $dom1->saveHtml(), "\n";
?>
--EXPECT--
-Inuse Attribute Error
+In Use Attribute Error
<container my-attribute="1"><element></element></container>