Page MenuHomePhabricator
Authored By
bzimport
Nov 21 2014, 10:18 PM
Size
1 KB
Referenced Files
None
Subscribers
None
Index: includes/parser/Parser.php
===================================================================
--- includes/parser/Parser.php (revision 64941)
+++ includes/parser/Parser.php (working copy)
@@ -3024,7 +3024,8 @@
&& $this->mOptions->getAllowSpecialInclusion()
&& $this->ot['html'] )
{
- $text = SpecialPage::capturePath( $title );
+ $argsArray = $frame->newChild( $args, $title )->getNamedArguments();
+ $text = SpecialPage::capturePath( $title, $argsArray );
if ( is_string( $text ) ) {
$found = true;
$isHTML = true;
Index: includes/SpecialPage.php
===================================================================
--- includes/SpecialPage.php (revision 64941)
+++ includes/SpecialPage.php (working copy)
@@ -580,15 +580,19 @@
* Returns false if there was no such special page, or a title object if it was
* a redirect.
*
+ * @param $title Title-by-reference object
+ * @param $args Optional argument array
* @return String: HTML fragment
*/
- static function capturePath( &$title ) {
- global $wgOut, $wgTitle;
+ static function capturePath( &$title, $args = array() ) {
+ global $wgOut, $wgTitle, $wgRequest;
$oldTitle = $wgTitle;
$oldOut = $wgOut;
+ $oldRequest = $wgRequest;
$wgOut = new OutputPage;
$wgOut->setTitle( $title );
+ $wgRequest = new FauxRequest( $args );
$ret = SpecialPage::executePath( $title, true );
if ( $ret === true ) {
@@ -596,6 +600,7 @@
}
$wgTitle = $oldTitle;
$wgOut = $oldOut;
+ $wgRequest = $oldRequest;
return $ret;
}

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4638
Default Alt Text
patch (1 KB)

Event Timeline