Merge "Remove extra unneeded whitespace"
[lhc/web/wiklou.git] / includes / specials / SpecialFewestrevisions.php
index 454e72c..5610cc2 100644 (file)
@@ -56,7 +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' => array( 'page_namespace', 'page_title', 'page_is_redirect' ) )
                );
        }
 
@@ -68,32 +68,30 @@ class FewestrevisionsPage extends QueryPage {
        /**
         * @param $skin Skin object
         * @param $result Object: database row
+        * @return String
         */
        function formatResult( $skin, $result ) {
-               global $wgLang, $wgContLang;
+               global $wgContLang;
 
                $nt = Title::makeTitleSafe( $result->namespace, $result->title );
                if( !$nt ) {
-                       return '<!-- bad title -->';
+                       return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ),
+                               Linker::getInvalidTitleDescription( $this->getContext(), $result->namespace, $result->title ) );
                }
 
-               $text = $wgContLang->convert( $nt->getPrefixedText() );
+               $text = htmlspecialchars( $wgContLang->convert( $nt->getPrefixedText() ) );
+               $plink = Linker::linkKnown( $nt, $text );
 
-               $plink = $skin->linkKnown(
-                       $nt,
-                       $text
-               );
-
-               $nl = wfMsgExt( 'nrevisions', array( 'parsemag', 'escape' ),
-                       $wgLang->formatNum( $result->value ) );
-               $redirect = isset($result->redirect) ? ' - ' . wfMsgHtml( 'isredirect' ) : '';
-               $nlink = $skin->linkKnown(
+               $nl = $this->msg( 'nrevisions' )->numParams( $result->value )->escaped();
+               $redirect = isset( $result->redirect ) && $result->redirect ?
+                       ' - ' . $this->msg( 'isredirect' )->escaped() : '';
+               $nlink = Linker::linkKnown(
                        $nt,
                        $nl,
                        array(),
                        array( 'action' => 'history' )
                ) . $redirect;
 
-               return wfSpecialList( $plink, $nlink );
+               return $this->getLanguage()->specialList( $plink, $nlink );
        }
 }