]> granicus.if.org Git - php/commitdiff
MFB (make it really W3C compatible (unlink node, when in tree...))
authorChristian Stocker <chregu@php.net>
Tue, 4 Mar 2003 13:38:38 +0000 (13:38 +0000)
committerChristian Stocker <chregu@php.net>
Tue, 4 Mar 2003 13:38:38 +0000 (13:38 +0000)
ext/domxml/php_domxml.c

index 5e2b9b343ad5d798edc78c21bef190b41e0fd505..9027d42a806d46ff2103ab2a543a7b3a7c73a1c0 100644 (file)
@@ -2329,8 +2329,8 @@ PHP_FUNCTION(domxml_node_append_child)
                RETURN_FALSE;
        }
        
-       /* first unlink node, if child is already a child of parent */
-       if (child->parent == parent){
+       /* first unlink node, if child is already in the tree */
+       if (child->doc == parent->doc && child->parent != NULL){
                xmlUnlinkNode(child);
        }