follow-up r59522 and r59735. only redirect to a variant URL when logged out.
authorPhilip Tzou <philip@users.mediawiki.org>
Sat, 5 Dec 2009 05:39:21 +0000 (05:39 +0000)
committerPhilip Tzou <philip@users.mediawiki.org>
Sat, 5 Dec 2009 05:39:21 +0000 (05:39 +0000)
includes/Wiki.php

index efb5cc1..faeb6e8 100644 (file)
@@ -212,8 +212,12 @@ class MediaWiki {
                          ( !isset($this->GET['variant']) && $wgContLang->hasVariants() && !$wgUser->isLoggedIn() ) ) &&
                        !count( array_diff( array_keys( $this->GET ), array( 'action', 'title' ) ) ) )
                {
-                       $pref = $wgContLang->getPreferredVariant( $fromUser = false, $fromHeader = true );
-                       $targetUrl = $title->getFullURL( $variant = $pref );
+                       if( !$wgUser->isLoggedIn() ) {
+                               $pref = $wgContLang->getPreferredVariant( false, $fromHeader = true );
+                               $targetUrl = $title->getFullURL( '', $variant = $pref );
+                       }
+                       else
+                               $targetUrl = $title->getFullURL();
                        // Redirect to canonical url, make it a 301 to allow caching
                        if( $targetUrl == $request->getFullRequestURL() ) {
                                $message = "Redirect loop detected!\n\n" .