@@ -1044,51 +1044,7 @@ PHP_METHOD(DOMNode, replaceChild)
1044
1044
RETURN_FALSE ;
1045
1045
}
1046
1046
1047
- <<<<<<< HEAD
1048
1047
if (oldchild -> parent != nodep ) {
1049
- = == == ==
1050
- /* check for the old child and whether the new child is already a child */
1051
- while (children ) {
1052
- if (children == oldchild ) {
1053
- foundoldchild = 1 ;
1054
- break ;
1055
- }
1056
- children = children -> next ;
1057
- }
1058
-
1059
- if (foundoldchild ) {
1060
- if (newchild -> type == XML_DOCUMENT_FRAG_NODE ) {
1061
- xmlNodePtr prevsib , nextsib ;
1062
- prevsib = oldchild -> prev ;
1063
- nextsib = oldchild -> next ;
1064
-
1065
- xmlUnlinkNode (oldchild );
1066
-
1067
- newchild = _php_dom_insert_fragment (nodep , prevsib , nextsib , newchild , intern , newchildobj );
1068
- if (newchild ) {
1069
- dom_reconcile_ns (nodep -> doc , newchild );
1070
- }
1071
- } else if (oldchild != newchild ) {
1072
- xmlDtdPtr intSubset = xmlGetIntSubset (nodep -> doc );
1073
- replacedoctype = (intSubset == (xmlDtd * ) oldchild );
1074
-
1075
- if (newchild -> doc == NULL && nodep -> doc != NULL ) {
1076
- xmlSetTreeDoc (newchild , nodep -> doc );
1077
- newchildobj -> document = intern -> document ;
1078
- php_libxml_increment_doc_ref ((php_libxml_node_object * )newchildobj , NULL );
1079
- }
1080
-
1081
- xmlReplaceNode (oldchild , newchild );
1082
- dom_reconcile_ns (nodep -> doc , newchild );
1083
-
1084
- if (replacedoctype ) {
1085
- nodep -> doc -> intSubset = (xmlDtd * ) newchild ;
1086
- }
1087
- }
1088
- DOM_RET_OBJ (oldchild , & ret , intern );
1089
- return ;
1090
- } else {
1091
- >>>>>>> PHP - 8.0
1092
1048
php_dom_throw_error (NOT_FOUND_ERR , stricterror );
1093
1049
RETURN_FALSE ;
1094
1050
}
0 commit comments