From: Philip Tzou Date: Sat, 5 Dec 2009 05:39:21 +0000 (+0000) Subject: follow-up r59522 and r59735. only redirect to a variant URL when logged out. X-Git-Tag: 1.31.0-rc.0~38620 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/fiche.php?a=commitdiff_plain;h=13d7d9936a56002ce37b0199b22b75d94afc461c;p=lhc%2Fweb%2Fwiklou.git follow-up r59522 and r59735. only redirect to a variant URL when logged out. --- 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" .