r82791 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82790‎ | r82791 | r82792 >
Date:11:48, 25 February 2011
Author:ialex
Status:ok
Tags:
Comment:
* (bug 27680) Fix for r82273: wgCanonicalSpecialPageName no longer false when requesting a special page with subpage parameter

The problem is that in this case $wgOut's Title object is not exactely the same $wgTitle because of line 600 of SpecialPage:
$wgTitle = $page->getTitle();
which strips the subpage parameter. Now using SpecialPage::resolveAliasWithSubpage() so that it works in all cases.

Also PHP strikes again for not allowing SpecialPage::resolveAliasWithSubpage( $title->getDBkey() )[0] syntax. YAY :)
Modified paths:
  • /trunk/phase3/includes/OutputPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/OutputPage.php
@@ -2611,11 +2611,16 @@
26122612 $title = $this->getTitle();
26132613 $ns = $title->getNamespace();
26142614 $nsname = MWNamespace::exists( $ns ) ? MWNamespace::getCanonicalName( $ns ) : $title->getNsText();
 2615+ if ( $ns == NS_SPECIAL ) {
 2616+ $parts = SpecialPage::resolveAliasWithSubpage( $title->getDBkey() );
 2617+ $canonicalName = $parts[0];
 2618+ } else {
 2619+ $canonicalName = false; # bug 21115
 2620+ }
26152621
26162622 $vars = array(
26172623 'wgCanonicalNamespace' => $nsname,
2618 - 'wgCanonicalSpecialPageName' => $ns == NS_SPECIAL ?
2619 - SpecialPage::resolveAlias( $title->getDBkey() ) : false, # bug 21115
 2624+ 'wgCanonicalSpecialPageName' => $canonicalName,
26202625 'wgNamespaceNumber' => $title->getNamespace(),
26212626 'wgPageName' => $title->getPrefixedDBKey(),
26222627 'wgTitle' => $title->getText(),

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r82273Moved Skin::makeGlobalVariablesScript() to OutputPage::getJSVars()...ialex18:25, 16 February 2011

Status & tagging log