* If the user is at Special:Preferences and logs out, returnto them to the
authorÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Sat, 29 Oct 2005 01:54:37 +0000 (01:54 +0000)
committerÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Sat, 29 Oct 2005 01:54:37 +0000 (01:54 +0000)
  default return location rather than to Special:Preferences which they can't
  access when logged out

includes/SkinTemplate.php

index 4098d5f..1496e20 100644 (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")] ) ) {