Merge "jquery.suggestions: Load initial suggestions only when focused"
[lhc/web/wiklou.git] / includes / content / FileContentHandler.php
index 843d540..6a1cc62 100644 (file)
@@ -1,12 +1,14 @@
 <?php
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * Content handler for File: files
  * TODO: this handler s not used directly now,
  * but instead manually called by WikitextHandler.
  * This should be fixed in the future.
  */
-class FileContentHandler extends WikitextContentHandler  {
+class FileContentHandler extends WikitextContentHandler {
 
        public function getFieldsForSearchIndex( SearchEngine $engine ) {
                $fields['file_media_type'] =
@@ -41,7 +43,8 @@ class FileContentHandler extends WikitextContentHandler  {
                if ( NS_FILE != $title->getNamespace() ) {
                        return [];
                }
-               $file = wfLocalFile( $title );
+               $file = MediaWikiServices::getInstance()->getRepoGroup()->getLocalRepo()
+                       ->newFile( $title );
                if ( !$file || !$file->exists() ) {
                        return [];
                }