diff options
author | Christian Stocker <chregu@php.net> | 2002-09-09 20:21:31 +0000 |
---|---|---|
committer | Christian Stocker <chregu@php.net> | 2002-09-09 20:21:31 +0000 |
commit | 2375745ab46249846e0cedd8272dab610258ec4c (patch) | |
tree | 2eaf776d550ce04d37248f9a2f222536fb752813 /ext/domxml/php_domxml.c | |
parent | 2c6154d7aa8950660209822541275339647ca74d (diff) | |
download | php-git-2375745ab46249846e0cedd8272dab610258ec4c.tar.gz |
Fix for bug 19266 (don't allow appending nodes from 2 different documents)
Diffstat (limited to 'ext/domxml/php_domxml.c')
-rw-r--r-- | ext/domxml/php_domxml.c | 7 |
1 files changed, 6 insertions, 1 deletions
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); |