add tests for {{#special:}}
[lhc/web/wiklou.git] / includes / SpecialPopularpages.php
index 930e3e9..77d4143 100644 (file)
@@ -5,11 +5,6 @@
  * @subpackage SpecialPage
  */
 
-/**
- *
- */
-require_once( "QueryPage.php" );
-
 /**
  *
  * @package MediaWiki
@@ -43,9 +38,10 @@ class PopularPagesPage extends QueryPage {
        function formatResult( $skin, $result ) {
                global $wgLang, $wgContLang;
                $title = Title::makeTitle( $result->namespace, $result->title );
-               $link = $skin->makeKnownLinkObj( $title, $wgContLang->convert( $title->getPrefixedText() ) );
-               $nv = wfMsg( "nviews", $wgLang->formatNum( $result->value ) );
-               return "{$link} ({$nv})";
+               $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) );
+               $nv = wfMsgExt( 'nviews', array( 'parsemag', 'escape'),
+                       $wgLang->formatNum( $result->value ) );
+               return wfSpecialList($link, $nv);
        }
 }
 
@@ -54,9 +50,9 @@ class PopularPagesPage extends QueryPage {
  */
 function wfSpecialPopularpages() {
     list( $limit, $offset ) = wfCheckLimits();
-    
+
     $ppp = new PopularPagesPage();
-    
+
     return $ppp->doQuery( $offset, $limit );
 }