X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialMostlinkedcategories.php;h=f238f6c086c93233e9bc45e6231c4446742c8e5e;hb=8b220cb5b6c5d3779b20a1d59de97291ece80282;hp=956207f883a56e71b7f3972c54245e1b3a6ebb5a;hpb=c6b1dede111e00d8993c4177c9678d17d035e5ed;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialMostlinkedcategories.php b/includes/specials/SpecialMostlinkedcategories.php index 956207f883..56a701a304 100644 --- a/includes/specials/SpecialMostlinkedcategories.php +++ b/includes/specials/SpecialMostlinkedcategories.php @@ -24,7 +24,8 @@ * @author Ævar Arnfjörð Bjarmason */ -use Wikimedia\Rdbms\ResultWrapper; +use MediaWiki\MediaWikiServices; +use Wikimedia\Rdbms\IResultWrapper; use Wikimedia\Rdbms\IDatabase; /** @@ -59,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 ); @@ -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 );