From ff3856aeb4eff5efbca044906f2d651d166e67cf Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sat, 29 Oct 2005 01:54:37 +0000 Subject: [PATCH] * If the user is at Special:Preferences and logs out, returnto them to the default return location rather than to Special:Preferences which they can't access when logged out --- includes/SkinTemplate.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 4098d5f57d..1496e20404 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -438,7 +438,7 @@ class SkinTemplate extends Skin { * @access private */ function buildPersonalUrls() { - global $wgTitle, $wgShowIPinHeader; + global $wgTitle, $wgShowIPinHeader, $wgContLang; $fname = 'SkinTemplate::buildPersonalUrls'; $pageurl = $wgTitle->getLocalURL(); @@ -480,7 +480,9 @@ class SkinTemplate extends Skin { ); $personal_urls['logout'] = array( 'text' => wfMsg('userlogout'), - 'href' => $this->makeSpecialUrl('Userlogout','returnto=' . $this->thisurl ) + 'href' => $this->makeSpecialUrl( 'Userlogout', + $this->thisurl === $wgContLang->getNsText( NS_SPECIAL ) . ':' . 'Preferences' ? '' : "returnto={$this->thisurl}" + ) ); } else { if( $wgShowIPinHeader && isset( $_COOKIE[ini_get("session.name")] ) ) { -- 2.20.1