Update to match core changes in Idc11b547
Change-Id: I5481df33c7056cf2c661527f6ed3cf2374b6a0bf
This commit is contained in:
@@ -133,7 +133,7 @@ class UniversalLanguageSelectorHooks {
|
|||||||
* @param $code String
|
* @param $code String
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function getLanguage( $user, &$code, $request = null ) {
|
public static function getLanguage( $user, &$code, $context = null ) {
|
||||||
global $wgUser, $wgRequest, $wgULSLanguageDetection;
|
global $wgUser, $wgRequest, $wgULSLanguageDetection;
|
||||||
if ( !self::isToolbarEnabled( $user ) ) {
|
if ( !self::isToolbarEnabled( $user ) ) {
|
||||||
return true;
|
return true;
|
||||||
@@ -142,13 +142,15 @@ class UniversalLanguageSelectorHooks {
|
|||||||
/* Before $request is passed to this, check if the given user
|
/* Before $request is passed to this, check if the given user
|
||||||
* name matches the current user name to detect if we are not
|
* name matches the current user name to detect if we are not
|
||||||
* running in the primary request context. See bug 44010 */
|
* running in the primary request context. See bug 44010 */
|
||||||
if ( $request === null ) {
|
if ( !$context instanceof RequestContext ) {
|
||||||
if ( $wgUser->getName() !== $user->getName() ) {
|
if ( $wgUser->getName() !== $user->getName() ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Should be safe to use the global request now
|
// Should be safe to use the global request now
|
||||||
$request = $wgRequest;
|
$request = $wgRequest;
|
||||||
|
} else {
|
||||||
|
$request = $context->getRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
$languageToSave = $request->getVal( 'setlang' );
|
$languageToSave = $request->getVal( 'setlang' );
|
||||||
|
|||||||
Reference in New Issue
Block a user