r98123 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98122‎ | r98123 | r98124 >
Date:11:33, 26 September 2011
Author:ialex
Status:ok
Tags:
Comment:
* Call Linker methods statically
* Use local context instead of global variables
Modified paths:
  • /trunk/phase3/includes/specials/SpecialFewestrevisions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialFewestrevisions.php
@@ -70,25 +70,21 @@
7171 * @param $result Object: database row
7272 */
7373 function formatResult( $skin, $result ) {
74 - global $wgLang, $wgContLang;
 74+ global $wgContLang;
7575
7676 $nt = Title::makeTitleSafe( $result->namespace, $result->title );
7777 if( !$nt ) {
7878 return '<!-- bad title -->';
7979 }
8080
81 - $text = $wgContLang->convert( $nt->getPrefixedText() );
 81+ $text = htmlspecialchars( $wgContLang->convert( $nt->getPrefixedText() ) );
 82+ $plink = Linker::linkKnown( $nt, $text );
8283
83 - $plink = $skin->linkKnown(
 84+ $nl = $this->msg( 'nrevisions' )->numParams( $result->value )->escaped();
 85+ $redirect = isset( $result->redirect ) && $result->redirect ?
 86+ ' - ' . wfMsgHtml( 'isredirect' ) : '';
 87+ $nlink = Linker::linkKnown(
8488 $nt,
85 - $text
86 - );
87 -
88 - $nl = wfMsgExt( 'nrevisions', array( 'parsemag', 'escape' ),
89 - $wgLang->formatNum( $result->value ) );
90 - $redirect = isset( $result->redirect ) ? ' - ' . wfMsgHtml( 'isredirect' ) : '';
91 - $nlink = $skin->linkKnown(
92 - $nt,
9389 $nl,
9490 array(),
9591 array( 'action' => 'history' )

Status & tagging log