Add additional check to avoid lazyload hook affect other skin

This commit is contained in:
alistair3149 2020-08-06 02:13:17 -04:00
parent 03c1b75b04
commit 143ecb98e7

View file

@ -77,6 +77,12 @@ class CitizenHooks {
* @return bool
*/
public static function onThumbnailBeforeProduceHTML( $thumb, &$attribs, &$linkAttribs ) {
// It's better to exit before any additional check
// Seems like the hook somehow affected other skins
if ( $context->getSkin() !== 'citizen' ) {
return;
}
try {
$config = MediaWikiServices::getInstance()->getConfigFactory()->makeConfig( 'Citizen' );
$lazyloadEnabled = $config->get( 'CitizenEnableLazyload' );