r59754 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59753‎ | r59754 | r59755 >
Date:05:39, 5 December 2009
Author:philip
Status:deferred
Tags:
Comment:
follow-up r59522 and r59735. only redirect to a variant URL when logged out.
Modified paths:
  • /trunk/phase3/includes/Wiki.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Wiki.php
@@ -212,8 +212,12 @@
213213 ( !isset($this->GET['variant']) && $wgContLang->hasVariants() && !$wgUser->isLoggedIn() ) ) &&
214214 !count( array_diff( array_keys( $this->GET ), array( 'action', 'title' ) ) ) )
215215 {
216 - $pref = $wgContLang->getPreferredVariant( $fromUser = false, $fromHeader = true );
217 - $targetUrl = $title->getFullURL( $variant = $pref );
 216+ if( !$wgUser->isLoggedIn() ) {
 217+ $pref = $wgContLang->getPreferredVariant( false, $fromHeader = true );
 218+ $targetUrl = $title->getFullURL( '', $variant = $pref );
 219+ }
 220+ else
 221+ $targetUrl = $title->getFullURL();
218222 // Redirect to canonical url, make it a 301 to allow caching
219223 if( $targetUrl == $request->getFullRequestURL() ) {
220224 $message = "Redirect loop detected!\n\n" .

Follow-up revisions

RevisionCommit summaryAuthorDate
r756171. Revert the complicated redirection I made in r59754;...philip16:58, 28 October 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r59522bug 21672: Add Accept-Language to Vary and XVO headers to help Squid to deter...philip19:13, 28 November 2009
r59735follow-up r59522 and r59541. To make the condition when we'll use Accept-Lang...philip15:47, 4 December 2009

Status & tagging log