Skip to content

Guard namespace prefix lookup for non-element nodes - #25755

Closed
imattas wants to merge 1 commit into
php:PHP-8.4from
imattas:codex/php-dom-lookup-prefix
Closed

imattas wants to merge 1 commit into
php:PHP-8.4from
imattas:codex/php-dom-lookup-prefix

Conversation

@imattas

@imattas imattas commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Description

Dom\Node::lookupPrefix() can reach the namespace-prefix helper with a non-element parent for text nodes inside DTD entity declarations. The helper reads element-specific namespace and attribute fields before checking the node type. Return NULL for non-elements and add a regression test for this case.

Testing

  • The minimal XML reproducer crashes before the guard and returns NULL after it in a local ASan build of PHP 8.7.0-dev.
  • ext/dom/tests/modern/spec/Node_lookupPrefix.phpt passes (1 test).

@devnexen

Copy link
Copy Markdown
Member

same, please target 8.4. Thx

@imattas
imattas changed the base branch from master to PHP-8.4 November 25, 2026 18:38
@imattas

imattas commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

@devnexen Will do! When do security advisorys I submit get reviewed btw?

@devnexen

devnexen commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

for both PRs, you need to do something along these lines locally

git fetch upstream
git rebase --onto upstream/PHP-8.4 upstream/master codex/dom-notation-handler-fix
git push --force-with-lease origin codex/dom-notation-handler-fix

otherwise if you do not feel at ease with it, you can always recreate these PRs no big deal.

@devnexen

Copy link
Copy Markdown
Member

@devnexen Will do! When do security advisorys I submit get reviewed btw?

cannot be specific, but they will be assessed in due time, a bit of patience is needed ;)

@imattas

imattas commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

lmao sounds good patience always is a issue for me cause of the ADHD and still being only 15 in my teen years xD anyways, the PRs will be rebased to 8.4 soon!

@imattas
imattas force-pushed the codex/php-dom-lookup-prefix branch from b2e85be to ef5b8d1 Compare November 25, 2026 18:46
@imattas imattas closed this Nov 25, 2026
@imattas
imattas deleted the codex/php-dom-lookup-prefix branch November 25, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants