r85299 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85298‎ | r85299 | r85300 >
Date:23:56, 3 April 2011
Author:dantman
Status:ok
Tags:
Comment:
Followup r85278, remove duplication of userlang code.
Modified paths:
  • /trunk/phase3/includes/StubObject.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/StubObject.php
@@ -146,24 +146,6 @@
147147 }
148148
149149 function _newObject() {
150 - global $wgLanguageCode, $wgRequest, $wgUser, $wgContLang;
151 - $code = $wgRequest->getVal( 'uselang', $wgUser->getOption( 'language' ) );
152 - // BCP 47 - letter case MUST NOT carry meaning
153 - $code = strtolower( $code );
154 -
155 - # Validate $code
156 - if( empty( $code ) || !Language::isValidCode( $code ) || ( $code === 'qqq' ) ) {
157 - wfDebug( "Invalid user language code\n" );
158 - $code = $wgLanguageCode;
159 - }
160 -
161 - wfRunHooks( 'UserGetLanguageObject', array( $wgUser, &$code ) );
162 -
163 - if( $code === $wgLanguageCode ) {
164 - return $wgContLang;
165 - } else {
166 - $obj = Language::factory( $code );
167 - return $obj;
168 - }
 150+ return RequestContext::getMain()->lang;
169151 }
170152 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r85278Follow-up to r85240:...happy-melon20:40, 3 April 2011

Status & tagging log