context: Replace deprecated User::getOption

Bug: T296083
Change-Id: I90f129d469163a5e277664f452547cf840a38b58
This commit is contained in:
Umherirrender 2022-04-29 21:46:30 +02:00
parent 7f9c52e082
commit 03e66106d0

View file

@ -448,7 +448,9 @@ class RequestContext implements IContextSource, MutableContext {
// Optimisation: Avoid slow getVal(), this isn't user-generated content.
$code = $request->getRawVal( 'uselang', 'user' );
if ( $code === 'user' ) {
$code = $user->getOption( 'language' );
$userOptionsLookup = MediaWikiServices::getInstance()
->getUserOptionsLookup();
$code = $userOptionsLookup->getOption( $user, 'language' );
}
// There are certain characters we don't allow in language code strings,
@ -510,7 +512,9 @@ class RequestContext implements IContextSource, MutableContext {
// No hook override, go through normal processing
if ( !in_array( 'skin',
$this->getConfig()->get( MainConfigNames::HiddenPrefs ) ) ) {
$userSkin = $this->getUser()->getOption( 'skin' );
$userOptionsLookup = MediaWikiServices::getInstance()
->getUserOptionsLookup();
$userSkin = $userOptionsLookup->getOption( $this->getUser(), 'skin' );
// Optimisation: Avoid slow getVal(), this isn't user-generated content.
$userSkin = $this->getRequest()->getRawVal( 'useskin', $userSkin );
} else {