From: Rob Richards Date: Mon, 27 Oct 2003 01:12:53 +0000 (+0000) Subject: cannot import nodes without document X-Git-Tag: RELEASE_2_0_0RC1~65 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a807b34427550a774289e84e843601cb24886748;p=php cannot import nodes without document --- diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index bea7f810e3..7fc199d41d 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -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); }