From 2375745ab46249846e0cedd8272dab610258ec4c Mon Sep 17 00:00:00 2001 From: Christian Stocker Date: Mon, 9 Sep 2002 20:21:31 +0000 Subject: [PATCH] Fix for bug 19266 (don't allow appending nodes from 2 different documents) --- ext/domxml/php_domxml.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c index 5129825743..7dee8c69b1 100644 --- a/ext/domxml/php_domxml.c +++ b/ext/domxml/php_domxml.c @@ -2375,7 +2375,12 @@ PHP_FUNCTION(domxml_node_append_child) php_error(E_WARNING, "%s(): can't append attribute node", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } - + + if (!(child->doc == NULL || child->doc == parent->doc)) { + php_error(E_WARNING, "%s(): Can't append node, which is in a different document than the parent node", get_active_function_name(TSRMLS_C)); + RETURN_FALSE; + } + /* first unlink node, if child is already a child of parent */ if (child->parent == parent){ xmlUnlinkNode(child); -- 2.40.0