From 13d7d9936a56002ce37b0199b22b75d94afc461c Mon Sep 17 00:00:00 2001 From: Philip Tzou Date: Sat, 5 Dec 2009 05:39:21 +0000 Subject: [PATCH] follow-up r59522 and r59735. only redirect to a variant URL when logged out. --- includes/Wiki.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/Wiki.php b/includes/Wiki.php index efb5cc1db0..faeb6e84a1 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -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" . -- 2.20.1