Don't pass default pref as fallback to User::getOption()

User::getOption() already handles that, and this code bypassed the hook
in User::getDefaultOptions().

Change-Id: I41f9df177988dffd62de0060cb691a97161729e4
This commit is contained in:
Kunal Mehta 2016-01-26 10:07:39 -08:00
parent 74fde6270d
commit 59afdff5d5

View file

@ -155,7 +155,7 @@ class PageImages {
* @return bool
*/
public static function onInfoAction( IContextSource $context, &$pageInfo ) {
global $wgDefaultUserOptions, $wgThumbLimits;
global $wgThumbLimits;
$imageFile = self::getPageImage( $context->getTitle() );
if ( !$imageFile ) {
@ -163,10 +163,7 @@ class PageImages {
return true;
}
$thumbSetting = $context->getUser()->getOption(
'thumbsize',
$wgDefaultUserOptions['thumbsize']
);
$thumbSetting = $context->getUser()->getOption( 'thumbsize' );
$thumbSize = $wgThumbLimits[$thumbSetting];
$thumb = $imageFile->transform( array( 'width' => $thumbSize ) );