From 0a45e7dc7636baedbd062386217c663dd41f8417 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Thu, 29 Sep 2011 15:14:34 +0000 Subject: [PATCH] Per Aaron, follow-up r93758: add coments and fix typos --- includes/SpecialPageFactory.php | 8 ++++---- includes/parser/Parser.php | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/includes/SpecialPageFactory.php b/includes/SpecialPageFactory.php index 25adf2259a..290f115b7b 100644 --- a/includes/SpecialPageFactory.php +++ b/includes/SpecialPageFactory.php @@ -476,9 +476,9 @@ class SpecialPageFactory { /** * Just like executePath() but will override global variables and execute - * the page in "inclusion" mode. Returns true if the excution was successful - * or false if there was no such special page, or a title object if it was - * a redirect. + * the page in "inclusion" mode. Returns true if the execution was + * successful or false if there was no such special page, or a title object + * if it was a redirect. * * Also saves the current $wgTitle, $wgOut, $wgRequest, $wgUser and $wgLang * variables so that the special page will get the context it'd expect on a @@ -509,7 +509,7 @@ class SpecialPageFactory { // The useful part $ret = self::executePath( $title, $context, true ); - // And restore that globals + // And restore the old globals $wgTitle = $oldTitle; $wgOut = $oldOut; $wgRequest = $oldRequest; diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 7677818f26..eef496cf14 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -3221,6 +3221,9 @@ class Parser { && $this->mOptions->getAllowSpecialInclusion() && $this->ot['html'] ) { + // Pass the template arguments as URL parameters. + // "uselang" will have no effect since the Language object + // is forced to the one defined in ParserOptions. $pageArgs = array(); for ( $i = 0; $i < $args->getLength(); $i++ ) { $bits = $args->item( $i )->splitArg(); @@ -3230,6 +3233,8 @@ class Parser { $pageArgs[$name] = $value; } } + + // Create a new context to execute the special page $context = new RequestContext; $context->setTitle( $title ); $context->setRequest( new FauxRequest( $pageArgs ) ); -- 2.20.1