[php-src] PR #23801: ext/dom: Register id attributes set via setAttribute() in XML documents
| From: | iliaal | Date: | Sun, 20 Sep 2026 16:13:27 +0000 |
| Subject: | [php-src] PR #23801: ext/dom: Register id attributes set via setAttribute() in XML documents | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-38639@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/23801
Author: iliaal
dom_check_register_attribute_id() sets XML_ATTRIBUTE_ID only when the document is
XML_HTML_DOCUMENT_NODE, so Dom\XMLDocument::getElementById() returns null after
setAttribute("id", ...) even though the id property registered fine. Dropping the
document-type restriction lets modern XML documents register an un-namespaced id attribute,
setIdAttribute(false) still unregisters, and legacy DOMDocument is unchanged because every helper
call site sits behind spec mode. All three call sites were audited.