Merge "maintenance: Script to rename titles for Unicode uppercasing changes"
[lhc/web/wiklou.git] / includes / specials / SpecialFewestrevisions.php
index f20829f..c47d87b 100644 (file)
@@ -21,6 +21,8 @@
  * @ingroup SpecialPage
  */
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * Special page for listing the articles with the fewest revisions.
  *
@@ -50,7 +52,8 @@ class FewestrevisionsPage extends QueryPage {
                                'redirect' => 'page_is_redirect'
                        ],
                        'conds' => [
-                               'page_namespace' => MWNamespace::getContentNamespaces(),
+                               'page_namespace' => MediaWikiServices::getInstance()->getNamespaceInfo()->
+                                       getContentNamespaces(),
                                'page_id = rev_page' ],
                        'options' => [
                                'GROUP BY' => [ 'page_namespace', 'page_title', 'page_is_redirect' ]
@@ -68,8 +71,6 @@ class FewestrevisionsPage extends QueryPage {
         * @return string
         */
        function formatResult( $skin, $result ) {
-               global $wgContLang;
-
                $nt = Title::makeTitleSafe( $result->namespace, $result->title );
                if ( !$nt ) {
                        return Html::element(
@@ -83,8 +84,9 @@ class FewestrevisionsPage extends QueryPage {
                        );
                }
                $linkRenderer = $this->getLinkRenderer();
-               $text = $wgContLang->convert( $nt->getPrefixedText() );
-               $plink = $linkRenderer->makeLink( $nt, $text );
+               $text = MediaWikiServices::getInstance()->getContentLanguage()->
+                       convert( htmlspecialchars( $nt->getPrefixedText() ) );
+               $plink = $linkRenderer->makeLink( $nt, new HtmlArmor( $text ) );
 
                $nl = $this->msg( 'nrevisions' )->numParams( $result->value )->text();
                $redirect = isset( $result->redirect ) && $result->redirect ?