* 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
This commit is contained in:
Ævar Arnfjörð Bjarmason 2005-10-29 01:54:37 +00:00
parent af47b8260c
commit ff3856aeb4

View file

@ -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")] ) ) {