mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
Fix bad merge
This commit is contained in:
parent
c36a1ea1ae
commit
5739dd0030
@ -1044,51 +1044,7 @@ PHP_METHOD(DOMNode, replaceChild)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
if (oldchild->parent != nodep) {
|
||||
=======
|
||||
/* check for the old child and whether the new child is already a child */
|
||||
while (children) {
|
||||
if (children == oldchild) {
|
||||
foundoldchild = 1;
|
||||
break;
|
||||
}
|
||||
children = children->next;
|
||||
}
|
||||
|
||||
if (foundoldchild) {
|
||||
if (newchild->type == XML_DOCUMENT_FRAG_NODE) {
|
||||
xmlNodePtr prevsib, nextsib;
|
||||
prevsib = oldchild->prev;
|
||||
nextsib = oldchild->next;
|
||||
|
||||
xmlUnlinkNode(oldchild);
|
||||
|
||||
newchild = _php_dom_insert_fragment(nodep, prevsib, nextsib, newchild, intern, newchildobj);
|
||||
if (newchild) {
|
||||
dom_reconcile_ns(nodep->doc, newchild);
|
||||
}
|
||||
} else if (oldchild != newchild) {
|
||||
xmlDtdPtr intSubset = xmlGetIntSubset(nodep->doc);
|
||||
replacedoctype = (intSubset == (xmlDtd *) oldchild);
|
||||
|
||||
if (newchild->doc == NULL && nodep->doc != NULL) {
|
||||
xmlSetTreeDoc(newchild, nodep->doc);
|
||||
newchildobj->document = intern->document;
|
||||
php_libxml_increment_doc_ref((php_libxml_node_object *)newchildobj, NULL);
|
||||
}
|
||||
|
||||
xmlReplaceNode(oldchild, newchild);
|
||||
dom_reconcile_ns(nodep->doc, newchild);
|
||||
|
||||
if (replacedoctype) {
|
||||
nodep->doc->intSubset = (xmlDtd *) newchild;
|
||||
}
|
||||
}
|
||||
DOM_RET_OBJ(oldchild, &ret, intern);
|
||||
return;
|
||||
} else {
|
||||
>>>>>>> PHP-8.0
|
||||
php_dom_throw_error(NOT_FOUND_ERR, stricterror);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user