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

index ca07268c6d8b81a4e18a0a0c6f9126ce29aea928..8b5f8976e92e24a8bec06de46dfc7fdc8b1357c6 100644 (file)
@@ -2308,8 +2308,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);
        }