r98686 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98685‎ | r98686 | r98687 >
Date:16:30, 2 October 2011
Author:ialex
Status:ok
Tags:
Comment:
* Use local context instead of global variables
* Call Linker methods statically
Modified paths:
  • /trunk/phase3/includes/specials/SpecialShortpages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialShortpages.php
@@ -86,23 +86,22 @@
8787 }
8888
8989 function formatResult( $skin, $result ) {
90 - global $wgLang;
91 - $dm = $wgLang->getDirMark();
 90+ $dm = $this->getLang()->getDirMark();
9291
9392 $title = Title::makeTitle( $result->namespace, $result->title );
9493 if ( !$title ) {
9594 return '<!-- Invalid title ' . htmlspecialchars( "{$result->namespace}:{$result->title}" ). '-->';
9695 }
97 - $hlink = $skin->linkKnown(
 96+ $hlink = Linker::linkKnown(
9897 $title,
9998 wfMsgHtml( 'hist' ),
10099 array(),
101100 array( 'action' => 'history' )
102101 );
103102 $plink = $this->isCached()
104 - ? $skin->link( $title )
105 - : $skin->linkKnown( $title );
106 - $size = wfMessage( 'nbytes', $wgLang->formatNum( $result->value ) )->escaped();
 103+ ? Linker::link( $title )
 104+ : Linker::linkKnown( $title );
 105+ $size = $this->msg( 'nbytes' )->numParams( $result->value )->escaped();
107106
108107 return $title->exists()
109108 ? "({$hlink}) {$dm}{$plink} {$dm}[{$size}]"

Status & tagging log