Moved wfSpecialList() to Language::specialList() so that it can be used in the contex...
[lhc/web/wiklou.git] / includes / specials / SpecialFewestrevisions.php
index 10d8e6b..a59f78f 100644 (file)
@@ -32,7 +32,7 @@ class FewestrevisionsPage extends QueryPage {
        function __construct( $name = 'Fewestrevisions' ) {
                parent::__construct( $name );
        }
-       
+
        function isExpensive() {
                return true;
        }
@@ -56,8 +56,7 @@ class FewestrevisionsPage extends QueryPage {
                        // useful to remove this. People _do_ create pages
                        // and never revise them, they aren't necessarily
                        // redirects.
-                               'GROUP BY' => 'page_namespace, page_title, ' .
-                                               'page_is_redirect' )
+                       'GROUP BY' => 'page_namespace, page_title, page_is_redirect' )
                );
        }
 
@@ -71,30 +70,26 @@ class FewestrevisionsPage extends QueryPage {
         * @param $result Object: database row
         */
        function formatResult( $skin, $result ) {
-               global $wgLang, $wgContLang;
+               global $wgContLang;
 
                $nt = Title::makeTitleSafe( $result->namespace, $result->title );
                if( !$nt ) {
                        return '<!-- bad title -->';
                }
 
-               $text = $wgContLang->convert( $nt->getPrefixedText() );
-
-               $plink = $skin->linkKnown(
-                       $nt,
-                       $text
-               );
+               $text = htmlspecialchars( $wgContLang->convert( $nt->getPrefixedText() ) );
+               $plink = Linker::linkKnown( $nt, $text );
 
-               $nl = wfMsgExt( 'nrevisions', array( 'parsemag', 'escape' ),
-                       $wgLang->formatNum( $result->value ) );
-               $redirect = $result->redirect ? ' - ' . wfMsgHtml( 'isredirect' ) : '';
-               $nlink = $skin->linkKnown(
+               $nl = $this->msg( 'nrevisions' )->numParams( $result->value )->escaped();
+               $redirect = isset( $result->redirect ) && $result->redirect ?
+                       ' - ' . wfMsgHtml( 'isredirect' ) : '';
+               $nlink = Linker::linkKnown(
                        $nt,
                        $nl,
                        array(),
                        array( 'action' => 'history' )
                ) . $redirect;
 
-               return wfSpecialList( $plink, $nlink );
+               return $this->getLang()->specialList( $plink, $nlink );
        }
 }