* @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
*/
+use MediaWiki\MediaWikiServices;
+
/**
* Searches the database for files of the requested MIME type, comparing this with the
* 'img_major_mime' and 'img_minor_mime' fields in the image table.
// Allow wildcard searching
$minorType['img_minor_mime'] = $this->minor;
}
+ $imgQuery = LocalFile::getQueryInfo();
$qi = [
- 'tables' => [ 'image' ],
+ 'tables' => $imgQuery['tables'],
'fields' => [
'namespace' => NS_FILE,
'title' => 'img_name',
'img_size',
'img_width',
'img_height',
- 'img_user_text',
+ 'img_user_text' => $imgQuery['fields']['img_user_text'],
'img_timestamp'
],
'conds' => [
MEDIATYPE_3D,
],
] + $minorType,
+ 'join_conds' => $imgQuery['joins'],
];
return $qi;
}
public function execute( $par ) {
- $this->mime = $par ? $par : $this->getRequest()->getText( 'mime' );
+ $this->mime = $par ?: $this->getRequest()->getText( 'mime' );
$this->mime = trim( $this->mime );
list( $this->major, $this->minor ) = File::splitMime( $this->mime );
* @return string
*/
function formatResult( $skin, $result ) {
- global $wgContLang;
-
$linkRenderer = $this->getLinkRenderer();
$nt = Title::makeTitle( $result->namespace, $result->title );
- $text = $wgContLang->convert( $nt->getText() );
+ $text = MediaWikiServices::getInstance()->getContentLanguage()->convert( $nt->getText() );
$plink = $linkRenderer->makeLink(
Title::newFromText( $nt->getPrefixedText() ),
$text