Index: trunk/phase3/includes/SpecialPageFactory.php |
— | — | @@ -476,9 +476,9 @@ |
477 | 477 | |
478 | 478 | /** |
479 | 479 | * Just like executePath() but will override global variables and execute |
480 | | - * the page in "inclusion" mode. Returns true if the excution was successful |
481 | | - * or false if there was no such special page, or a title object if it was |
482 | | - * a redirect. |
| 480 | + * the page in "inclusion" mode. Returns true if the execution was |
| 481 | + * successful or false if there was no such special page, or a title object |
| 482 | + * if it was a redirect. |
483 | 483 | * |
484 | 484 | * Also saves the current $wgTitle, $wgOut, $wgRequest, $wgUser and $wgLang |
485 | 485 | * variables so that the special page will get the context it'd expect on a |
— | — | @@ -509,7 +509,7 @@ |
510 | 510 | // The useful part |
511 | 511 | $ret = self::executePath( $title, $context, true ); |
512 | 512 | |
513 | | - // And restore that globals |
| 513 | + // And restore the old globals |
514 | 514 | $wgTitle = $oldTitle; |
515 | 515 | $wgOut = $oldOut; |
516 | 516 | $wgRequest = $oldRequest; |
Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -3221,6 +3221,9 @@ |
3222 | 3222 | && $this->mOptions->getAllowSpecialInclusion() |
3223 | 3223 | && $this->ot['html'] ) |
3224 | 3224 | { |
| 3225 | + // Pass the template arguments as URL parameters. |
| 3226 | + // "uselang" will have no effect since the Language object |
| 3227 | + // is forced to the one defined in ParserOptions. |
3225 | 3228 | $pageArgs = array(); |
3226 | 3229 | for ( $i = 0; $i < $args->getLength(); $i++ ) { |
3227 | 3230 | $bits = $args->item( $i )->splitArg(); |
— | — | @@ -3230,6 +3233,8 @@ |
3231 | 3234 | $pageArgs[$name] = $value; |
3232 | 3235 | } |
3233 | 3236 | } |
| 3237 | + |
| 3238 | + // Create a new context to execute the special page |
3234 | 3239 | $context = new RequestContext; |
3235 | 3240 | $context->setTitle( $title ); |
3236 | 3241 | $context->setRequest( new FauxRequest( $pageArgs ) ); |