* @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.
->setMethod( 'get' )
->prepareForm()
->displayForm( false );
+ return '';
}
protected function getSuggestionsForTypes() {
* @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( htmlspecialchars( $nt->getText() ) );
$plink = $linkRenderer->makeLink(
Title::newFromText( $nt->getPrefixedText() ),
- $text
+ new HtmlArmor( $text )
);
$download = Linker::makeMediaLinkObj( $nt, $this->msg( 'download' )->escaped() );