Merge "Make DBAccessBase use DBConnRef, rename $wiki, and hide getLoadBalancer()"
[lhc/web/wiklou.git] / includes / gallery / TraditionalImageGallery.php
index 4d5222c..fadd587 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+
+use MediaWiki\MediaWikiServices;
+
 /**
  * Image gallery.
  *
@@ -87,7 +90,7 @@ class TraditionalImageGallery extends ImageGalleryBase {
                                        # Fetch and register the file (file title may be different via hooks)
                                        list( $img, $nt ) = $this->mParser->fetchFileAndTitle( $nt, $options );
                                } else {
-                                       $img = wfFindFile( $nt );
+                                       $img = MediaWikiServices::getInstance()->getRepoGroup()->findFile( $nt );
                                }
                        } else {
                                $img = false;
@@ -108,8 +111,8 @@ class TraditionalImageGallery extends ImageGalleryBase {
                                if ( $this->mParser instanceof Parser ) {
                                        $this->mParser->addTrackingCategory( 'broken-file-category' );
                                }
-                       } elseif ( $this->mHideBadImages
-                               && wfIsBadImage( $nt->getDBkey(), $this->getContextTitle() )
+                       } elseif ( $this->mHideBadImages && MediaWikiServices::getInstance()->getBadFileLookup()
+                               ->isBadFile( $nt->getDBkey(), $this->getContextTitle() )
                        ) {
                                # The image is blacklisted, just show it as a text link.
                                $thumbhtml = "\n\t\t\t" . '<div class="thumb" style="height: ' .