summaryrefslogtreecommitdiff
path: root/ext/domxml/php_domxml.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/domxml/php_domxml.c')
-rw-r--r--ext/domxml/php_domxml.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c
index 0a58581316..38b407d186 100644
--- a/ext/domxml/php_domxml.c
+++ b/ext/domxml/php_domxml.c
@@ -2296,6 +2296,12 @@ PHP_FUNCTION(domxml_node_append_child)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't append attribute node");
RETURN_FALSE;
}
+
+ /* XXX:ls */
+ if (child == parent) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't append node to itself");
+ RETURN_FALSE;
+ }
if (!(child->doc == NULL || child->doc == parent->doc)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't append node, which is in a different document than the parent node");