summaryrefslogtreecommitdiff
path: root/includes/SkinTemplate.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2012-01-12 13:42:29 +0100
committerPierre Schmitz <pierre@archlinux.de>2012-01-12 13:42:29 +0100
commitba0fc4fa20067528effd4802e53ceeb959640825 (patch)
tree4f62217349d3afa39dbba3f7e19dac0aecb344f6 /includes/SkinTemplate.php
parentca32f08966f1b51fcb19460f0996bb0c4048e6fe (diff)
Update to MediaWiki 1.18.1
Diffstat (limited to 'includes/SkinTemplate.php')
-rw-r--r--includes/SkinTemplate.php24
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();