function __construct( $name = 'Fewestrevisions' ) {
parent::__construct( $name );
}
-
+
function isExpensive() {
return true;
}
// 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' )
);
}
* @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 );
}
}