http://www.mediawiki.org/wiki/Special:Code/MediaWiki/82791
Revision: 82791
Author: ialex
Date: 2011-02-25 11:48:14 +0000 (Fri, 25 Feb 2011)
Log Message:
-----------
* (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: trunk/phase3/includes/OutputPage.php
===================================================================
--- trunk/phase3/includes/OutputPage.php 2011-02-25 11:37:14 UTC (rev
82790)
+++ trunk/phase3/includes/OutputPage.php 2011-02-25 11:48:14 UTC (rev
82791)
@@ -2611,11 +2611,16 @@
$title = $this->getTitle();
$ns = $title->getNamespace();
$nsname = MWNamespace::exists( $ns ) ?
MWNamespace::getCanonicalName( $ns ) : $title->getNsText();
+ if ( $ns == NS_SPECIAL ) {
+ $parts = SpecialPage::resolveAliasWithSubpage(
$title->getDBkey() );
+ $canonicalName = $parts[0];
+ } else {
+ $canonicalName = false; # bug 21115
+ }
$vars = array(
'wgCanonicalNamespace' => $nsname,
- 'wgCanonicalSpecialPageName' => $ns == NS_SPECIAL ?
- SpecialPage::resolveAlias( $title->getDBkey() )
: false, # bug 21115
+ 'wgCanonicalSpecialPageName' => $canonicalName,
'wgNamespaceNumber' => $title->getNamespace(),
'wgPageName' => $title->getPrefixedDBKey(),
'wgTitle' => $title->getText(),
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs