Skip to content

Reject DTD declaration nodes in adoptNode - #25758

Closed
imattas wants to merge 2 commits into
php:PHP-8.4from
imattas:adopt-dtd-declarations-guard
Closed

imattas wants to merge 2 commits into
php:PHP-8.4from
imattas:adopt-dtd-declarations-guard

Conversation

@imattas

@imattas imattas commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Closes #25750

Reject XML_ELEMENT_DECL, XML_ATTRIBUTE_DECL, and XML_ENTITY_DECL nodes before cross-document adoption mutates libxml ownership. These declarations remain owned by their source DTD, and moving them can crash during document teardown.

Adds a modern DOM regression test for element and entity declarations. Focused PHPT passes on PHP 8.4.29-dev with ASan (1/1).

@iliaal iliaal closed this in 5835cf2 Nov 27, 2026
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.

3 participants