diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2012-01-12 13:42:29 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2012-01-12 13:42:29 +0100 |
commit | ba0fc4fa20067528effd4802e53ceeb959640825 (patch) | |
tree | 4f62217349d3afa39dbba3f7e19dac0aecb344f6 /includes/SkinTemplate.php | |
parent | ca32f08966f1b51fcb19460f0996bb0c4048e6fe (diff) |
Update to MediaWiki 1.18.1
Diffstat (limited to 'includes/SkinTemplate.php')
-rw-r--r-- | includes/SkinTemplate.php | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 373daa9d..ef104bd7 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -480,7 +480,9 @@ class SkinTemplate extends Skin { 'text' => ( $wgContLang->getLanguageName( $nt->getInterwiki() ) != '' ? $wgContLang->getLanguageName( $nt->getInterwiki() ) : $l ), 'title' => $nt->getText(), - 'class' => $class + 'class' => $class, + 'lang' => $nt->getInterwiki(), + 'hreflang' => $nt->getInterwiki(), ); } } @@ -580,11 +582,19 @@ class SkinTemplate extends Skin { /* set up the default links for the personal toolbar */ $personal_urls = array(); - $page = $wgRequest->getVal( 'returnto', $this->thispage ); - $query = $wgRequest->getVal( 'returntoquery', $this->thisquery ); - $a = array( 'returnto' => $page ); - if( $query != '' ) { - $a['returntoquery'] = $query; + # Due to bug 32276, if a user does not have read permissions, + # $this->getTitle() will just give Special:Badtitle, which is + # not especially useful as a returnto parameter. Use the title + # from the request instead, if there was one. + $page = Title::newFromURL( $wgRequest->getVal( 'title', '' ) ); + $page = $wgRequest->getVal( 'returnto', $page ); + $a = array(); + if ( strval( $page ) !== '' ) { + $a['returnto'] = $page; + $query = $wgRequest->getVal( 'returntoquery', $this->thisquery ); + if( $query != '' ) { + $a['returntoquery'] = $query; + } } $returnto = wfArrayToCGI( $a ); if( $this->loggedin ) { @@ -843,7 +853,7 @@ class SkinTemplate extends Skin { wfRunHooks( 'SkinTemplatePreventOtherActiveTabs', array( &$this, &$preventActiveTabs ) ); // Checks if page is some kind of content - if( $title->getNamespace() != NS_SPECIAL ) { + if( $title->canExist() ) { // Gets page objects for the related namespaces $subjectPage = $title->getSubjectPage(); $talkPage = $title->getTalkPage(); |