Per Aaron, follow-up r93758: add coments and fix typos
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Thu, 29 Sep 2011 15:14:34 +0000 (15:14 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Thu, 29 Sep 2011 15:14:34 +0000 (15:14 +0000)
includes/SpecialPageFactory.php
includes/parser/Parser.php

index 25adf22..290f115 100644 (file)
@@ -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;
index 7677818..eef496c 100644 (file)
@@ -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 ) );