Remove workaround code only needed for MW 1.20 and lower

Change-Id: Ifc256ccc144fab2a359dcd9ef0ae7be6751a471c
This commit is contained in:
Niklas Laxström
2014-09-19 12:11:43 +02:00
parent 18fe41ccf7
commit f1d969efdb

View File

@@ -187,31 +187,17 @@ class UniversalLanguageSelectorHooks {
* Hook to UserGetLanguageObject
* @param User $user
* @param string $code
* @param RequestContext $context Optional RequestContext
* @param RequestContext $context
* @return bool
*/
public static function getLanguage( $user, &$code, $context = null ) {
public static function getLanguage( User $user, &$code, RequestContext $context ) {
global $wgULSAnonCanChangeLanguage, $wgULSLanguageDetection;
if ( !self::isToolbarEnabled( $user ) ) {
return true;
}
/* Before $request is passed to this, check if the given user
* name matches the current user name to detect if we are not
* running in the primary request context. See bug 44010 */
if ( !$context instanceof RequestContext ) {
global $wgUser, $wgRequest;
if ( $wgUser->getName() !== $user->getName() ) {
return true;
}
// Should be safe to use the global request now
$request = $wgRequest;
} else {
$request = $context->getRequest();
}
$request = $context->getRequest();
$languageToSave = $request->getVal( 'setlang' );
if ( $request->getVal( 'uselang' ) && !$languageToSave ) {