From 161db1b519f4d2e2faf5af65ae5930ffaa0f0dbf Mon Sep 17 00:00:00 2001 From: Christian Stocker Date: Tue, 4 Mar 2003 13:29:18 +0000 Subject: [PATCH] make it really W3C compatible (unlink node, when in tree...) --- ext/domxml/php_domxml.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c index ca07268c6d..8b5f8976e9 100644 --- a/ext/domxml/php_domxml.c +++ b/ext/domxml/php_domxml.c @@ -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); } -- 2.40.0