]> granicus.if.org Git - php/commitdiff
Fragment must have associated document to append xml otherwise it is read-only
authorRob Richards <rrichards@php.net>
Fri, 18 Feb 2005 11:57:24 +0000 (11:57 +0000)
committerRob Richards <rrichards@php.net>
Fri, 18 Feb 2005 11:57:24 +0000 (11:57 +0000)
ext/dom/documentfragment.c

index c4501db30f464e24fec2a120f1ce813bc3610278..06797af443689d09cb1e78fbafc574f938674b8f 100644 (file)
@@ -123,6 +123,11 @@ PHP_METHOD(domdocumentfragment, appendXML) {
 
        DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
 
+       if (dom_node_is_read_only(nodep) == SUCCESS) {
+               php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+               RETURN_FALSE;
+       }
+
        if (data) {
                err = xmlParseBalancedChunkMemory(nodep->doc, NULL, NULL, 0, data, &lst);
                if (err != 0) {