Created
November 6, 2014 05:57
-
-
Save swtaarrs/2577519dbcf6e6e062a2 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..03e685f 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 (domnewchildnode->doc().get()) { | |
+ removeOrphanIfNeeded(*domnewchildnode->doc_data()->m_orphans, | |
+ domnewchildnode->m_node); | |
+ } | |
+ return create_node_object(oldchild, data->doc(), oldchild != newchild); | |
} | |
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