follow-up r59522 and r59735. only redirect to a variant URL when logged out.

This commit is contained in:
Philip Tzou 2009-12-05 05:39:21 +00:00
parent fd042bfebd
commit 13d7d9936a

View 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" .