Skip to content

dom: normalize null namespace in getNamedItemNS - #253

Open
iliaal wants to merge 1 commit into
PHP-8.5from
fix/aph-lw0-85
Open

dom: normalize null namespace in getNamedItemNS#253
iliaal wants to merge 1 commit into
PHP-8.5from
fix/aph-lw0-85

Conversation

@iliaal

@iliaal iliaal commented Aug 24, 2026

Copy link
Copy Markdown
Owner

getNamedItemNS() with a null namespace incorrectly matched attributes that have one after a refactor funneled both named-item lookups through one handler path where null fell back to qualified-name matching. The entry points now split into dedicated vtable methods: the null-namespace lookup matches only attributes without a namespace via xmlHasNsProp() with a null namespace, while getNamedItem(), array access and property access keep qualified-name matching. getAttributeNS(), hasAttributeNS() and getAttributeNodeNS() were audited and are unaffected.

The named-item refactor moved getNamedItem and getNamedItemNS onto a
shared lookup where a null namespace fell back to qualified-name
matching, letting getNamedItemNS(null, name) return attributes that do
have a namespace. Split the two entry points into dedicated handler
methods: the null-namespace lookup now only matches attributes without
a namespace (with HTML adjusted-local-name handling), while
getNamedItem() and array/property access keep qualified-name matching.
Sibling audit found no other affected paths; getAttributeNS(),
hasAttributeNS() and getAttributeNodeNS() already use xmlHasNsProp.
@iliaal iliaal closed this Aug 24, 2026
@iliaal iliaal reopened this Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant