Merge "Parser: Refactor parsing of [[File:...|link=...]] syntax for reusability"
[lhc/web/wiklou.git] / includes / specials / SpecialWantedcategories.php
index fc0c312..5c62298 100644 (file)
@@ -23,6 +23,8 @@
  * @ingroup SpecialPage
  */
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * A querypage to list the most wanted categories - implements Special:Wantedcategories
  *
@@ -88,10 +90,9 @@ class WantedCategoriesPage extends WantedQueryPage {
         * @return string
         */
        function formatResult( $skin, $result ) {
-               global $wgContLang;
-
                $nt = Title::makeTitle( $result->namespace, $result->title );
-               $text = $wgContLang->convert( $nt->getText() );
+               $text = new HtmlArmor( MediaWikiServices::getInstance()->getContentLanguage()
+                       ->convert( htmlspecialchars( $nt->getText() ) ) );
 
                if ( !$this->isCached() ) {
                        // We can assume the freshest data
@@ -103,9 +104,7 @@ class WantedCategoriesPage extends WantedQueryPage {
                } else {
                        $plink = $this->getLinkRenderer()->makeLink( $nt, $text );
 
-                       $currentValue = isset( $this->currentCategoryCounts[$result->title] )
-                               ? $this->currentCategoryCounts[$result->title]
-                               : 0;
+                       $currentValue = $this->currentCategoryCounts[$result->title] ?? 0;
                        $cachedValue = intval( $result->value ); // T76910
 
                        // If the category has been created or emptied since the list was refreshed, strike it