|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-04-18 02:03 UTC] steinm@php.net
[2002-04-27 04:39 UTC] dan at mojavelinux dot com
[2002-04-27 04:41 UTC] dan at mojavelinux dot com
[2002-08-14 12:54 UTC] chregu@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 08:00:01 2025 UTC |
When replace_node is used, if the new node being inserted already exists in the xml document, it is to be first removed. Thus, the following lines in the C code are incorrect... if (NULL == (new_repnode = xmlCopyNode(repnode, 1))) { php_error(E_WARNING, "%s(): unable to clone node", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } repnode = xmlReplaceNode(nodep, new_repnode); This code is making a copy of the new node, and hence when the libxml2 function xmlReplaceNode is run, it does not remove the node already existing in the document. The call to xmlReplaceNode should be the repnode, not the new_repnode. As a matter of fact, I see no need to even attempt to clone the node, unless it is to check that it is a true node. Thoughts?