chregu          Mon Sep  9 16:21:31 2002 EDT

  Modified files:              
    /php4/ext/domxml    php_domxml.c 
  Log:
  Fix for bug 19266 (don't allow appending nodes from 2 different documents)
  
  
Index: php4/ext/domxml/php_domxml.c
diff -u php4/ext/domxml/php_domxml.c:1.209 php4/ext/domxml/php_domxml.c:1.210
--- php4/ext/domxml/php_domxml.c:1.209  Wed Aug 28 05:28:06 2002
+++ php4/ext/domxml/php_domxml.c        Mon Sep  9 16:21:31 2002
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_domxml.c,v 1.209 2002/08/28 09:28:06 derick Exp $ */
+/* $Id: php_domxml.c,v 1.210 2002/09/09 20:21:31 chregu Exp $ */
 
 /* TODO
  * - Support Notation Nodes
@@ -2375,7 +2375,12 @@
                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);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to