mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ImageMap
synced 2024-11-23 22:03:31 +00:00
Use MediaWikiServices::getBadFileLookup
This required MediaWiki 1.34 (already set in extension.json) Change-Id: I6a7e51fed5718c33de67a530ce032f8725e0bfcc
This commit is contained in:
parent
c6a8e7fefe
commit
313fba8175
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue