Use MediaWikiServices::getBadFileLookup

This required MediaWiki 1.34 (already set in extension.json)

Change-Id: I6a7e51fed5718c33de67a530ce032f8725e0bfcc
This commit is contained in:
Umherirrender 2020-03-14 21:14:32 +01:00
parent c6a8e7fefe
commit 313fba8175

View file

@ -65,7 +65,9 @@ class ImageMap {
$defaultLinkAttribs = false; $defaultLinkAttribs = false;
$realmap = true; $realmap = true;
$extLinks = []; $extLinks = [];
$repoGroup = MediaWikiServices::getInstance()->getRepoGroup(); $services = MediaWikiServices::getInstance();
$repoGroup = $services->getRepoGroup();
$badFileLookup = $services->getBadFileLookup();
foreach ( $lines as $line ) { foreach ( $lines as $line ) {
++$lineNum; ++$lineNum;
$externLink = false; $externLink = false;
@ -91,7 +93,7 @@ class ImageMap {
if ( !$imageTitle || !$imageTitle->inNamespace( NS_FILE ) ) { if ( !$imageTitle || !$imageTitle->inNamespace( NS_FILE ) ) {
return self::error( 'imagemap_no_image' ); return self::error( 'imagemap_no_image' );
} }
if ( wfIsBadImage( $imageTitle->getDBkey(), $parser->mTitle ) ) { if ( $badFileLookup->isBadFile( $imageTitle->getDBkey(), $parser->mTitle ) ) {
return self::error( 'imagemap_bad_image' ); return self::error( 'imagemap_bad_image' );
} }
// Parse the options so we can use links and the like in the caption // Parse the options so we can use links and the like in the caption