diff options
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(); |