Skip to content

Fix modern Dom Notation property handlers - #25754

Closed
imattas wants to merge 4 commits into
php:PHP-8.4from
imattas:codex/dom-notation-handler-fix
Closed

imattas wants to merge 4 commits into
php:PHP-8.4from
imattas:codex/dom-notation-handler-fix

Conversation

@imattas

@imattas imattas commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Fixes #25752

The modern notation property table defines the publicId and systemId virtual handlers, but the class registry pointed to the generic node table. Reads fell through to standard property lookup and could crash the process. Register the notation-specific table, add direct property regression coverage, and update the notation var_dump expectation.

Testing:

  • Built PHP 8.7.0-dev at 23970fab063ecba9f63f86a5a788e7cd14e35f0e with AddressSanitizer. Before the fix, reading publicId crashed in zend_std_read_property(); after the fix, both parsed identifiers were returned.
  • Focused ext/dom tests on that patched build: 3 passed, 0 failed (Notation_properties, XMLDocument_node_notation_wiring, DTDNamedNodeMap).
  • Rebased onto latest master 5701fc611ecb3bd39a2323804b1e1811afb45f4f; the incorrect registration remains present there.

@devnexen

Copy link
Copy Markdown
Member

Hi @imattas the fix is correct however can you target PHP-8.4 ? there is my 21955 PR but that s alright I ll just rebase once yours is merged. Cheers.

@imattas
imattas changed the base branch from master to PHP-8.4 November 25, 2026 18:36
@imattas
imattas force-pushed the codex/dom-notation-handler-fix branch from a73ed83 to af4abde Compare November 25, 2026 18:44

var_dump($doctype->entities["test"]);
var_dump($doctype->entities["myimage"]);
// TODO: isConnected returning false is a bug

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

???

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please reestablish this comment ? no reason to remove it.

string(3) "GIF"
["baseURI"]=>
string(11) "about:blank"
string(%d) "%s"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this change ?

@devnexen devnexen closed this in 98dc7ae Nov 26, 2026
@devnexen

Copy link
Copy Markdown
Member

Thanks !

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.

ext/dom: reading Dom\Notation identifiers can crash PHP

2 participants