Merge "Various cleanups to MediaWiki::preOutputCommit"
[lhc/web/wiklou.git] / includes / Linker.php
index ae50c66..39f4394 100644 (file)
@@ -555,7 +555,8 @@ class Linker {
                                # Use manually specified thumbnail
                                $manual_title = Title::makeTitleSafe( NS_FILE, $frameParams['manualthumb'] );
                                if ( $manual_title ) {
-                                       $manual_img = wfFindFile( $manual_title );
+                                       $manual_img = MediaWikiServices::getInstance()->getRepoGroup()
+                                               ->findFile( $manual_title );
                                        if ( $manual_img ) {
                                                $thumb = $manual_img->getUnscaledThumb( $handlerParams );
                                                $manualthumb = true;
@@ -693,7 +694,8 @@ class Linker {
                        $label = $title->getPrefixedText();
                }
                $encLabel = htmlspecialchars( $label );
-               $currentExists = $time ? ( wfFindFile( $title ) != false ) : false;
+               $file = MediaWikiServices::getInstance()->getRepoGroup()->findFile( $title );
+               $currentExists = $time ? ( $file != false ) : false;
 
                if ( ( $wgUploadMissingFileUrl || $wgUploadNavigationUrl || $wgEnableUploads )
                        && !$currentExists
@@ -756,11 +758,13 @@ class Linker {
         * @since 1.16.3
         * @param LinkTarget $title
         * @param string $html Pre-sanitized HTML
-        * @param string $time MW timestamp of file creation time
+        * @param string|false $time MW timestamp of file creation time
         * @return string HTML
         */
        public static function makeMediaLinkObj( $title, $html = '', $time = false ) {
-               $img = wfFindFile( $title, [ 'time' => $time ] );
+               $img = MediaWikiServices::getInstance()->getRepoGroup()->findFile(
+                       $title, [ 'time' => $time ]
+               );
                return self::makeMediaLinkFile( $title, $img, $html );
        }