]> granicus.if.org Git - php/commitdiff
cannot import nodes without document
authorRob Richards <rrichards@php.net>
Mon, 27 Oct 2003 01:12:53 +0000 (01:12 +0000)
committerRob Richards <rrichards@php.net>
Mon, 27 Oct 2003 01:12:53 +0000 (01:12 +0000)
ext/simplexml/simplexml.c

index bea7f810e3a53b18d0fa1d8d7dc524dde9ca66b7..7fc199d41d4033b34f24e45f48c874205b5c225c 100644 (file)
@@ -1191,6 +1191,10 @@ PHP_FUNCTION(simplexml_import_dom)
 
        if (object->node && object->node->node) {
                nodep = object->node->node;
+               if (nodep->doc == NULL) {
+                       php_error(E_WARNING, "Imported Node must have associated Document");
+                       RETURN_NULL();
+               }
                if (nodep->type == XML_DOCUMENT_NODE || nodep->type == XML_HTML_DOCUMENT_NODE) {
                        nodep = xmlDocGetRootElement((xmlDocPtr) nodep);
                }