Merge "SpecialUnusedimages: Change message when CountCategorizedImagesAsUsed"
[lhc/web/wiklou.git] / includes / specials / SpecialMostlinkedcategories.php
index f238f6c..56a701a 100644 (file)
@@ -24,6 +24,7 @@
  * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
  */
 
+use MediaWiki\MediaWikiServices;
 use Wikimedia\Rdbms\IResultWrapper;
 use Wikimedia\Rdbms\IDatabase;
 
@@ -71,8 +72,6 @@ class MostlinkedCategoriesPage extends QueryPage {
         * @return string
         */
        function formatResult( $skin, $result ) {
-               global $wgContLang;
-
                $nt = Title::makeTitleSafe( NS_CATEGORY, $result->title );
                if ( !$nt ) {
                        return Html::element(
@@ -85,8 +84,9 @@ class MostlinkedCategoriesPage extends QueryPage {
                        );
                }
 
-               $text = $wgContLang->convert( $nt->getText() );
-               $plink = $this->getLinkRenderer()->makeLink( $nt, $text );
+               $text = MediaWikiServices::getInstance()->getContentLanguage()
+                       ->convert( htmlspecialchars( $nt->getText() ) );
+               $plink = $this->getLinkRenderer()->makeLink( $nt, new HtmlArmor( $text ) );
                $nlinks = $this->msg( 'nmembers' )->numParams( $result->value )->escaped();
 
                return $this->getLanguage()->specialList( $plink, $nlinks );