<?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'] =
if ( NS_FILE != $title->getNamespace() ) {
return [];
}
- $file = wfLocalFile( $title );
+ $file = MediaWikiServices::getInstance()->getRepoGroup()->getLocalRepo()
+ ->newFile( $title );
if ( !$file || !$file->exists() ) {
return [];
}