20
20
#endif
21
21
22
22
#include "php.h"
23
-
24
23
#if defined(HAVE_LIBXML ) && defined(HAVE_DOM )
25
24
#include "php_dom.h"
26
25
@@ -1002,7 +1001,6 @@ PHP_METHOD(DOMNode, replaceChild)
1002
1001
xmlNodePtr children , newchild , oldchild , nodep ;
1003
1002
dom_object * intern , * newchildobj , * oldchildobj ;
1004
1003
int foundoldchild = 0 , stricterror ;
1005
- bool replacedoctype = false;
1006
1004
1007
1005
int ret ;
1008
1006
@@ -1065,21 +1063,13 @@ PHP_METHOD(DOMNode, replaceChild)
1065
1063
dom_reconcile_ns (nodep -> doc , newchild );
1066
1064
}
1067
1065
} else if (oldchild != newchild ) {
1068
- xmlDtdPtr intSubset = xmlGetIntSubset (nodep -> doc );
1069
- replacedoctype = (intSubset == (xmlDtd * ) oldchild );
1070
-
1071
1066
if (newchild -> doc == NULL && nodep -> doc != NULL ) {
1072
1067
xmlSetTreeDoc (newchild , nodep -> doc );
1073
1068
newchildobj -> document = intern -> document ;
1074
1069
php_libxml_increment_doc_ref ((php_libxml_node_object * )newchildobj , NULL );
1075
1070
}
1076
-
1077
1071
xmlReplaceNode (oldchild , newchild );
1078
1072
dom_reconcile_ns (nodep -> doc , newchild );
1079
-
1080
- if (replacedoctype ) {
1081
- nodep -> doc -> intSubset = (xmlDtd * ) newchild ;
1082
- }
1083
1073
}
1084
1074
DOM_RET_OBJ (oldchild , & ret , intern );
1085
1075
return ;
@@ -1678,7 +1668,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
1678
1668
buf = xmlAllocOutputBuffer (NULL );
1679
1669
}
1680
1670
1681
- if (buf != NULL ) {
1671
+ if (buf != NULL ) {
1682
1672
ret = xmlC14NDocSaveTo (docp , nodeset , exclusive , inclusive_ns_prefixes ,
1683
1673
with_comments , buf );
1684
1674
}
@@ -1693,9 +1683,9 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
1693
1683
xmlXPathFreeContext (ctxp );
1694
1684
}
1695
1685
1696
- if (buf == NULL || ret < 0 ) {
1697
- RETVAL_FALSE ;
1698
- } else {
1686
+ if (buf == NULL || ret < 0 ) {
1687
+ RETVAL_FALSE ;
1688
+ } else {
1699
1689
if (mode == 0 ) {
1700
1690
#ifdef LIBXML2_NEW_BUFFER
1701
1691
ret = xmlOutputBufferGetSize (buf );
@@ -1712,7 +1702,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
1712
1702
RETVAL_EMPTY_STRING ();
1713
1703
}
1714
1704
}
1715
- }
1705
+ }
1716
1706
1717
1707
if (buf ) {
1718
1708
int bytes ;
0 commit comments