Last active
August 29, 2015 14:08
-
-
Save swtaarrs/5d14284c32b5f0661924 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/hphp/runtime/ext/domdocument/ext_domdocument.cpp b/hphp/runtime/ext/domdocument/ext_domdocument.cpp | |
index 6a35725..3270d8a 100644 | |
--- a/hphp/runtime/ext/domdocument/ext_domdocument.cpp | |
+++ b/hphp/runtime/ext/domdocument/ext_domdocument.cpp | |
@@ -2470,7 +2470,12 @@ Variant HHVM_METHOD(DOMNode, replaceChild, | |
xmlReplaceNode(oldchild, newchild); | |
dom_reconcile_ns(nodep->doc, newchild); | |
} | |
- return create_node_object(oldchild, data->doc(), false); | |
+ | |
+ if (auto newchilddoc = domnewchildnode->doc_data()) { | |
+ removeOrphanIfNeeded(*newchilddoc->m_orphans, domnewchildnode->m_node); | |
+ } | |
+ return create_node_object(oldchild, data->doc(), | |
+ oldchild->parent == nullptr); | |
} | |
php_dom_throw_error(NOT_FOUND_ERR, data->doc_data()->m_stricterror); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment