From: Brad Jorsch Date: Tue, 26 Aug 2014 15:20:00 +0000 (-0400) Subject: Handle multiple ownerDocuments for args in Preprocessor_DOM X-Git-Tag: 1.31.0-rc.0~14275 X-Git-Url: http://git.cyclocoop.org/data/Fool?a=commitdiff_plain;h=6a7b192a0a38ac578f93e269b636d60538155d5e;p=lhc%2Fweb%2Fwiklou.git Handle multiple ownerDocuments for args in Preprocessor_DOM As long as Preprocessor_DOM::newPartNodeArray returns nodes with different roots when called multiple times, PPFrame_DOM::newChild should be prepared to receive such. Bug: 70046 Change-Id: Ie048d8dbd3042f19d934ff0dd8d32b4c46f9f952 --- diff --git a/includes/parser/Preprocessor_DOM.php b/includes/parser/Preprocessor_DOM.php index 8416ac3c7b..2edb79a2af 100644 --- a/includes/parser/Preprocessor_DOM.php +++ b/includes/parser/Preprocessor_DOM.php @@ -1033,7 +1033,7 @@ class PPFrame_DOM implements PPFrame { if ( $arg instanceof PPNode ) { $arg = $arg->node; } - if ( !$xpath ) { + if ( !$xpath || $xpath->document !== $arg->ownerDocument ) { $xpath = new DOMXPath( $arg->ownerDocument ); }