Bug #81642 [Com]: DOMChildNode::replaceWith() bug when replacing a node with itself.

From: Date: Thu, 03 Mar 2022 12:08:40 +0000
Subject: Bug #81642 [Com]: DOMChildNode::replaceWith() bug when replacing a node with itself.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-240141@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81642&edit=1 ID: 81642 Comment by: tqergar435rg3 at protonmail dot com Reported by: jules dot bernable at gmail dot com Summary: DOMChildNode::replaceWith() bug when replacing a node with itself. Status: Open Type: Bug Package: DOM XML related Operating System: debian unstable PHP Version: 8.0.0 Block user comment: N Private report: N New Comment: thanks https://altosaxo.net/products/surfbort-t-shirt-men https://altosaxo.net/products/the-casket-lottery-t-shirt-men https://altosaxo.net/products/vulfpeck-t-shirt-men https://altosaxo.net/blogs/music-news-info/the-20-best-billie-eilish-songs https://altosaxo.net/products/as-friends-rust-t-shirt-men Previous Comments: ------------------------------------------------------------------------ [2022-03-03 12:07:54] fvznmfg32 at protonmail dot com Thanks https://altosaxo.net/products/blind-melon-t-shirt-men https://altosaxo.net/products/dirty-loops-t-shirt-men https://altosaxo.net/products/gorilla-biscuits-t-shirt-men https://altosaxo.net/products/the-regrettes-t-shirt-men https://altosaxo.net/products/blitzen-trapper-t-shirt-men ------------------------------------------------------------------------ [2022-03-03 12:07:19] lghtyukgh443 at protonmail dot com Thanks https://altosaxo.net/products/cate-le-bon-t-shirt-women https://altosaxo.net/products/okkultist-t-shirt-men https://altosaxo.net/products/ra-ra-riot-t-shirt-men https://altosaxo.net/products/slightly-stoopid-t-shirt-men https://altosaxo.net/products/alt-j-t-shirt-men ------------------------------------------------------------------------ [2021-11-19 16:51:53] jules dot bernable at gmail dot com Description: ------------ When calling DOMChildNode::replaceWith() on a given node, If the node is also part of the argument list, PHP either throws a DOMException or just hangs indefinitely. The bug is present at least in versions 8.0.12 and 8.1.0RC6 Test script: --------------- // example 1 $doc = new DOMDocument(); $doc->appendChild($target = $doc->createElement('test')); $target->replaceWith($target); // PHP Fatal error: Uncaught DOMException: Not Found Error // example 2 $doc = new DOMDocument(); $doc->appendChild($target = $doc->createElement('test')); $target->replaceWith($target, 'foo'); // program hangs indefinitely Expected result: ---------------- Both examples should be handled correctly, like browsers do. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=81642&edit=1

« previous php.bugs (#240141) next »