From 313fba8175ce4f66045fed7c18337c27d7eeff4a Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Sat, 14 Mar 2020 21:14:32 +0100 Subject: [PATCH] Use MediaWikiServices::getBadFileLookup This required MediaWiki 1.34 (already set in extension.json) Change-Id: I6a7e51fed5718c33de67a530ce032f8725e0bfcc --- includes/ImageMap.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/ImageMap.php b/includes/ImageMap.php index 6bd16c8..f51bd81 100644 --- a/includes/ImageMap.php +++ b/includes/ImageMap.php @@ -65,7 +65,9 @@ class ImageMap { $defaultLinkAttribs = false; $realmap = true; $extLinks = []; - $repoGroup = MediaWikiServices::getInstance()->getRepoGroup(); + $services = MediaWikiServices::getInstance(); + $repoGroup = $services->getRepoGroup(); + $badFileLookup = $services->getBadFileLookup(); foreach ( $lines as $line ) { ++$lineNum; $externLink = false; @@ -91,7 +93,7 @@ class ImageMap { if ( !$imageTitle || !$imageTitle->inNamespace( NS_FILE ) ) { 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' ); } // Parse the options so we can use links and the like in the caption