Skip to content

ext/dom: DOMNode::insertBefore() dropping the node used as its own re… - #23379

Open
devnexen wants to merge 1 commit into
php:PHP-8.4from
devnexen:gh23365
Open

ext/dom: DOMNode::insertBefore() dropping the node used as its own re…#23379
devnexen wants to merge 1 commit into
php:PHP-8.4from
devnexen:gh23365

Conversation

@devnexen

Copy link
Copy Markdown
Member

…ference.

Fix #23365

insertBefore($n, $n) unlinked the node, then rebuilt its position from the pointers the unlink had just cleared, leaving it out of the document with a self-referencing sibling list, freed twice at teardown. Retarget the reference to the node's next sibling, as the modern DOM already does.

…ference.

Fix php#23365

insertBefore($n, $n) unlinked the node, then rebuilt its position from the
pointers the unlink had just cleared, leaving it out of the document with a
self-referencing sibling list, freed twice at teardown. Retarget the reference
to the node's next sibling, as the modern DOM already does.
@devnexen
devnexen marked this pull request as ready for review August 19, 2026 17:10
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.

1 participant