@@ -820,7 +820,7 @@ zend_result dom_node_text_content_write(dom_object *obj, zval *newval)
820820
821821/* }}} */
822822
823- static xmlNodePtr _php_dom_insert_fragment (xmlNodePtr nodep , xmlNodePtr prevsib , xmlNodePtr nextsib , xmlNodePtr fragment , dom_object * intern , dom_object * childobj ) /* {{{ */
823+ static xmlNodePtr _php_dom_insert_fragment (xmlNodePtr nodep , xmlNodePtr prevsib , xmlNodePtr nextsib , xmlNodePtr fragment , dom_object * intern ) /* {{{ */
824824{
825825 xmlNodePtr newchild , node ;
826826
@@ -845,8 +845,8 @@ static xmlNodePtr _php_dom_insert_fragment(xmlNodePtr nodep, xmlNodePtr prevsib,
845845 node -> parent = nodep ;
846846 if (node -> doc != nodep -> doc ) {
847847 xmlSetTreeDoc (node , nodep -> doc );
848- if ( node -> _private != NULL ) {
849- childobj = node -> _private ;
848+ dom_object * childobj = node -> _private ;
849+ if ( childobj != NULL ) {
850850 childobj -> document = intern -> document ;
851851 php_libxml_increment_doc_ref ((php_libxml_node_object * )childobj , NULL );
852852 }
@@ -973,7 +973,7 @@ PHP_METHOD(DOMNode, insertBefore)
973973 }
974974 } else if (child -> type == XML_DOCUMENT_FRAG_NODE ) {
975975 xmlNodePtr last = child -> last ;
976- new_child = _php_dom_insert_fragment (parentp , refp -> prev , refp , child , intern , childobj );
976+ new_child = _php_dom_insert_fragment (parentp , refp -> prev , refp , child , intern );
977977 dom_reconcile_ns_list (parentp -> doc , new_child , last );
978978 } else {
979979 new_child = xmlAddPrevSibling (refp , child );
@@ -1023,7 +1023,7 @@ PHP_METHOD(DOMNode, insertBefore)
10231023 }
10241024 } else if (child -> type == XML_DOCUMENT_FRAG_NODE ) {
10251025 xmlNodePtr last = child -> last ;
1026- new_child = _php_dom_insert_fragment (parentp , parentp -> last , NULL , child , intern , childobj );
1026+ new_child = _php_dom_insert_fragment (parentp , parentp -> last , NULL , child , intern );
10271027 dom_reconcile_ns_list (parentp -> doc , new_child , last );
10281028 } else {
10291029 new_child = xmlAddChild (parentp , child );
@@ -1104,7 +1104,7 @@ PHP_METHOD(DOMNode, replaceChild)
11041104 xmlUnlinkNode (oldchild );
11051105
11061106 xmlNodePtr last = newchild -> last ;
1107- newchild = _php_dom_insert_fragment (nodep , prevsib , nextsib , newchild , intern , newchildobj );
1107+ newchild = _php_dom_insert_fragment (nodep , prevsib , nextsib , newchild , intern );
11081108 if (newchild ) {
11091109 dom_reconcile_ns_list (nodep -> doc , newchild , last );
11101110 }
@@ -1262,7 +1262,7 @@ PHP_METHOD(DOMNode, appendChild)
12621262 php_dom_reconcile_attribute_namespace_after_insertion ((xmlAttrPtr ) new_child );
12631263 } else if (child -> type == XML_DOCUMENT_FRAG_NODE ) {
12641264 xmlNodePtr last = child -> last ;
1265- new_child = _php_dom_insert_fragment (nodep , nodep -> last , NULL , child , intern , childobj );
1265+ new_child = _php_dom_insert_fragment (nodep , nodep -> last , NULL , child , intern );
12661266 dom_reconcile_ns_list (nodep -> doc , new_child , last );
12671267 } else {
12681268 new_child = xmlAddChild (nodep , child );
0 commit comments