[DOM] Fix getNamedItemNS() with empty URI not matching null namespace - #23498
Closed
iliaal wants to merge 1 commit into
Closed
[DOM] Fix getNamedItemNS() with empty URI not matching null namespace#23498iliaal wants to merge 1 commit into
iliaal wants to merge 1 commit into
Conversation
devnexen
reviewed
Aug 29, 2026
iliaal
force-pushed
the
fix/getnameditemns-empty-uri-84
branch
from
August 29, 2026 16:53
9f8f9b4 to
9ffb828
Compare
devnexen
requested changes
Aug 30, 2026
Normalize an empty URI to NULL in spec-following mode so xmlHasNsProp() matches null-namespace attributes, and skip XML_ATTRIBUTE_DECL results which cannot be wrapped as nodes. Closes phpGH-23498
iliaal
force-pushed
the
fix/getnameditemns-empty-uri-84
branch
from
August 30, 2026 14:11
9ffb828 to
f6a7645
Compare
devnexen
approved these changes
Aug 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dom\NamedNodeMap::getNamedItemNS() passed an empty-string URI straight to xmlHasNsProp(), which matches NULL-namespace attributes only when the URI pointer is NULL, so getNamedItemNS("", "bar") returned NULL even though hasAttributeNS("", "bar") found the attribute in spec-following mode. An empty URI now normalizes to NULL at the namednodemap entry point when a base object is present, the same conversion dom_get_attribute_ns() applies in element.c. A sibling audit of xmlHasNsProp() and xmlGetNsProp() call sites found no other path passing a user-supplied URI.