X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialMIMEsearch.php;h=18c163e138ab448d82932424b16d728845e4fa70;hb=90d4f56fe46140f9e97e2fa72698f98b57447fe5;hp=3290abd5a3e143e71a4e7e6feef68c323a95de24;hpb=6c9a2923fe1ee3a65cb027be5e781772f2b12fbd;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialMIMEsearch.php b/includes/specials/SpecialMIMEsearch.php index 3290abd5a3..18c163e138 100644 --- a/includes/specials/SpecialMIMEsearch.php +++ b/includes/specials/SpecialMIMEsearch.php @@ -22,6 +22,8 @@ * @author Ævar Arnfjörð Bjarmason */ +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. @@ -56,8 +58,9 @@ class MIMEsearchPage extends QueryPage { // 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', @@ -67,7 +70,7 @@ class MIMEsearchPage extends QueryPage { 'img_size', 'img_width', 'img_height', - 'img_user_text', + 'img_user_text' => $imgQuery['fields']['img_user_text'], 'img_timestamp' ], 'conds' => [ @@ -89,6 +92,7 @@ class MIMEsearchPage extends QueryPage { MEDIATYPE_3D, ], ] + $minorType, + 'join_conds' => $imgQuery['joins'], ]; return $qi; @@ -158,7 +162,7 @@ class MIMEsearchPage extends QueryPage { } 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 ); @@ -180,11 +184,9 @@ class MIMEsearchPage extends QueryPage { * @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