r103814 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103813‎ | r103814 | r103815 >
Date:15:30, 21 November 2011
Author:johnduhart
Status:resolved (Comments)
Tags:
Comment:
Bug 28296 - Installer should honor &uselang= parameter
Modified paths:
  • /trunk/phase3/includes/installer/WebInstaller.php (modified) (history)
  • /trunk/phase3/includes/installer/WebInstallerPage.php (modified) (history)
  • /trunk/phase3/mw-config/index.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/WebInstaller.php
@@ -12,7 +12,8 @@
1313 * @ingroup Deployment
1414 * @since 1.17
1515 */
16 -class WebInstaller extends Installer {
 16+class
 17+WebInstaller extends Installer {
1718
1819 /**
1920 * @var WebInstallerOutput
@@ -472,7 +473,6 @@
473474 $this->setVar( '_UserLang', $wgLanguageCode );
474475 } else {
475476 $wgLanguageCode = $this->getVar( 'wgLanguageCode' );
476 - $wgLang = Language::factory( $this->getVar( '_UserLang' ) );
477477 $wgContLang = Language::factory( $wgLanguageCode );
478478 }
479479 }
Index: trunk/phase3/includes/installer/WebInstallerPage.php
@@ -158,7 +158,7 @@
159159 public function execute() {
160160 global $wgLang;
161161 $r = $this->parent->request;
162 - $userLang = $r->getVal( 'UserLang' );
 162+ $userLang = $r->getVal( 'userlang' );
163163 $contLang = $r->getVal( 'ContLang' );
164164
165165 $lifetime = intval( ini_get( 'session.gc_maxlifetime' ) );
@@ -207,7 +207,7 @@
208208 }
209209 $this->startForm();
210210 $s = Html::hidden( 'LanguageRequestTime', time() ) .
211 - $this->getLanguageSelector( 'UserLang', 'config-your-language', $userLang,
 211+ $this->getLanguageSelector( 'userlang', 'config-your-language', $userLang,
212212 $this->parent->getHelpBox( 'config-your-language-help' ) ) .
213213 $this->getLanguageSelector( 'ContLang', 'config-wiki-language', $contLang,
214214 $this->parent->getHelpBox( 'config-wiki-language-help' ) );
Index: trunk/phase3/mw-config/index.php
@@ -34,10 +34,10 @@
3535 $session = array();
3636 }
3737
38 - if ( isset( $session['settings']['_UserLang'] ) ) {
 38+ if ( !is_null( $wgRequest->getVal( 'uselang' ) ) ) {
 39+ $langCode = $wgRequest->getVal( 'uselang' );
 40+ } elseif ( isset( $session['settings']['_UserLang'] ) ) {
3941 $langCode = $session['settings']['_UserLang'];
40 - } elseif ( !is_null( $wgRequest->getVal( 'UserLang' ) ) ) {
41 - $langCode = $wgRequest->getVal( 'UserLang' );
4242 } else {
4343 $langCode = 'en';
4444 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r103984Followup r103814, fixed a few typos and a stray newlinejohnduhart00:03, 23 November 2011

Comments

#Comment by Brion VIBBER (talk | contribs)   23:40, 22 November 2011

I see both 'userlang' and 'uselang' in use here -- something feels sketchy about this.

#Comment by Brion VIBBER (talk | contribs)   00:12, 23 November 2011

r103984 fixed that up

Status & tagging log