Bug #80600 [Com]: DOMChildNode::remove() doesn't work on CharacterData nodes

From: Date: Wed, 20 Jan 2021 11:10:04 +0000
Subject: Bug #80600 [Com]: DOMChildNode::remove() doesn't work on CharacterData nodes
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-231667@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80600&edit=1 ID: 80600 Comment by: guadalupelawrence96 at gmail dot com Reported by: jules dot bernable at gmail dot com Summary: DOMChildNode::remove() doesn't work on CharacterData nodes Status: Assigned Type: Bug Package: DOM XML related Operating System: debian PHP Version: 8.0.0 Assigned To: beberlei Block user comment: N Private report: N New Comment: Thanks for Sharing information. https://www.imessageapp.biz/imessage-app-for-pc-download/ Previous Comments: ------------------------------------------------------------------------ [2021-01-07 09:42:00] beberlei@php.net confirmed, also for other nodes that extend DOMCharacterData. DOMCharacterData::remove does not seem to use dom_child_node_remove helper function that was added at some point, but the code looks the same and correct anyways. Probably a mistake in the assumptions how DOMCharacterData nodes fit into libxml hierarchy. I will look into this over the next days. ------------------------------------------------------------------------ [2021-01-06 19:55:52] jules dot bernable at gmail dot com Description: ------------ CharacterData nodes implement the new DomChildNode interface, but the DOMChildNode::remove() method doesn't work. See the provided test script. Text, comments and CDATA nodes should be removed. They are not. Test script: --------------- <php $doc = new \DOMDocument(); $doc->loadXML('<a>foo</a>'); $doc->documentElement->firstChild->remove(); echo $doc->saveXML($doc->documentElement); Expected result: ---------------- <a></a> Actual result: -------------- <a>foo</a> ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=80600&edit=1

« previous php.bugs (#231667) next »