Merge "Update phpCharToUpper.json based on current differences"
[lhc/web/wiklou.git] / includes / specials / SpecialMostlinkedcategories.php
index 41678cb..56a701a 100644 (file)
  * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
  */
 
+use MediaWiki\MediaWikiServices;
+use Wikimedia\Rdbms\IResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
+
 /**
  * A querypage to show categories ordered in descending order by the pages in them
  *
@@ -56,7 +60,7 @@ class MostlinkedCategoriesPage extends QueryPage {
         * Fetch user page links and cache their existence
         *
         * @param IDatabase $db
-        * @param ResultWrapper $res
+        * @param IResultWrapper $res
         */
        function preprocessResults( $db, $res ) {
                $this->executeLBFromResultWrapper( $res );
@@ -68,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(
@@ -82,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 );