Skip to content

Disable old libxml2 hack if the version does not suffer from the bug #11379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions ext/dom/documentfragment.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ PHP_METHOD(DOMDocumentFragment, __construct)
}
/* }}} end DOMDocumentFragment::__construct */

#if LIBXML_VERSION <= 20614
/* php_dom_xmlSetTreeDoc is a custom implementation of xmlSetTreeDoc
needed for hack in appendXML due to libxml bug - no need to share this function */
static void php_dom_xmlSetTreeDoc(xmlNodePtr tree, xmlDocPtr doc) /* {{{ */
Expand Down Expand Up @@ -90,6 +91,7 @@ static void php_dom_xmlSetTreeDoc(xmlNodePtr tree, xmlDocPtr doc) /* {{{ */
}
}
/* }}} */
#endif

/* {{{ */
PHP_METHOD(DOMDocumentFragment, appendXML) {
Expand Down Expand Up @@ -118,10 +120,11 @@ PHP_METHOD(DOMDocumentFragment, appendXML) {
if (err != 0) {
RETURN_FALSE;
}
/* Following needed due to bug in libxml2 <= 2.6.14
ifdef after next libxml release as bug is fixed in their cvs */
#if LIBXML_VERSION <= 20614
/* Following needed due to bug in libxml2 <= 2.6.14 */
php_dom_xmlSetTreeDoc(lst, nodep->doc);
/* End stupid hack */
#endif

xmlAddChildList(nodep,lst);
}
Expand Down