r103911 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103910‎ | r103911 | r103912 >
Date:16:08, 22 November 2011
Author:johnduhart
Status:ok (Comments)
Tags:
Comment:
Changes from r103817
Modified paths:
  • /trunk/extensions/AbuseFilter/AbuseFilter.class.php (modified) (history)
  • /trunk/extensions/AbuseFilter/Views/AbuseFilterViewDiff.php (modified) (history)
  • /trunk/extensions/AbuseFilter/Views/AbuseFilterViewEdit.php (modified) (history)
  • /trunk/extensions/AbuseFilter/Views/AbuseFilterViewExamine.php (modified) (history)
  • /trunk/extensions/AbuseFilter/Views/AbuseFilterViewHistory.php (modified) (history)
  • /trunk/extensions/AbuseFilter/Views/AbuseFilterViewList.php (modified) (history)
  • /trunk/extensions/AbuseFilter/Views/AbuseFilterViewRevert.php (modified) (history)
  • /trunk/extensions/AbuseFilter/special/SpecialAbuseLog.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AbuseFilter/special/SpecialAbuseLog.php
@@ -350,7 +350,7 @@
351351 function formatRow( $row, $li = true ) {
352352 $user = $this->getUser();
353353 $sk = $this->getSkin();
354 - $lang = $this->getLang();
 354+ $lang = $this->getLanguage();
355355
356356 $actionLinks = array();
357357
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewDiff.php
@@ -22,7 +22,7 @@
2323 $links[$msg] = Linker::link( $title, wfMsgExt( $msg, 'parseinline' ) );
2424 }
2525
26 - $backlinks = $this->getLang()->pipeList( $links );
 26+ $backlinks = $this->getLanguage()->pipeList( $links );
2727 $out->addHTML( Xml::tags( 'p', null, $backlinks ) );
2828
2929 if ( $show ) {
@@ -150,7 +150,7 @@
151151
152152 function formatVersionLink( $timestamp, $history_id ) {
153153 $filter = $this->mFilter;
154 - $text = $this->getLang()->timeanddate( $timestamp, true );
 154+ $text = $this->getLanguage()->timeanddate( $timestamp, true );
155155 $title = $this->getTitle( "history/$filter/item/$history_id" );
156156
157157 $link = Linker::link( $title, $text );
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewList.php
@@ -113,7 +113,7 @@
114114 $overflow_percent = sprintf( "%.2f", 100 * $overflow_count / $total_count );
115115 $match_percent = sprintf( "%.2f", 100 * $match_count / $total_count );
116116
117 - $lang = $this->getLang();
 117+ $lang = $this->getLanguage();
118118 $status = wfMsgExt( 'abusefilter-status', array( 'parseinline' ),
119119 $lang->formatNum( $total_count ),
120120 $lang->formatNum( $overflow_count ),
@@ -180,7 +180,7 @@
181181 }
182182
183183 function formatValue( $name, $value ) {
184 - $lang = $this->getLang();
 184+ $lang = $this->getLanguage();
185185 $row = $this->mCurrentRow;
186186
187187 switch( $name ) {
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewHistory.php
@@ -38,7 +38,7 @@
3939 $links[$msg] = $sk->link( $title, wfMsgExt( $msg, 'parseinline' ) );
4040 }
4141
42 - $backlinks = $this->getLang()->pipeList( $links );
 42+ $backlinks = $this->getLanguage()->pipeList( $links );
4343 $out->addHTML( Xml::tags( 'p', null, $backlinks ) );
4444
4545 # For user
@@ -119,7 +119,7 @@
120120
121121 function formatValue( $name, $value ) {
122122 $sk = $this->getSkin();
123 - $lang = $this->getLang();
 123+ $lang = $this->getLanguage();
124124
125125 $row = $this->mCurrentRow;
126126
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewEdit.php
@@ -240,7 +240,7 @@
241241
242242 // Build the edit form
243243 $out = $this->getOutput();
244 - $lang = $this->getLang();
 244+ $lang = $this->getLanguage();
245245 $user = $this->getUser();
246246 $sk = $this->getSkin();
247247
@@ -655,7 +655,7 @@
656656
657657 $existingSelector->addOption( 'abusefilter-warning' );
658658
659 - $lang = $this->getLang();
 659+ $lang = $this->getLanguage();
660660 foreach( $res as $row ) {
661661 if ( $lang->lcfirst( $row->page_title ) == $lang->lcfirst( $warnMsg ) ) {
662662 $existingSelector->setDefault( $lang->lcfirst( $warnMsg ) );
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewExamine.php
@@ -123,7 +123,7 @@
124124 $vars = $vars->exportAllVars();
125125 }
126126
127 - $output = '';
 127+ $html = '';
128128
129129 $output->addModules( 'ext.abuseFilter.examine' );
130130
@@ -149,8 +149,8 @@
150150 'id' => 'mw-abusefilter-load'
151151 )
152152 );
153 - $output .= Xml::tags( 'div', array( 'id' => 'mw-abusefilter-examine-editor' ), $tester );
154 - $output .= Xml::tags( 'p',
 153+ $html .= Xml::tags( 'div', array( 'id' => 'mw-abusefilter-examine-editor' ), $tester );
 154+ $html .= Xml::tags( 'p',
155155 null,
156156 Xml::element( 'input',
157157 array(
@@ -169,10 +169,10 @@
170170 }
171171
172172 // Variable dump
173 - $output .= Xml::tags( 'h2', null, wfMsgExt( 'abusefilter-examine-vars', 'parseinline' ) );
174 - $output .= AbuseFilter::buildVarDumpTable( $vars );
 173+ $html .= Xml::tags( 'h2', null, wfMsgExt( 'abusefilter-examine-vars', 'parseinline' ) );
 174+ $html .= AbuseFilter::buildVarDumpTable( $vars );
175175
176 - $output->addHTML( $output );
 176+ $output->addHTML( $html );
177177 }
178178
179179 function loadParameters() {
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewRevert.php
@@ -56,7 +56,7 @@
5757
5858 // Look up all of them.
5959 $results = $this->doLookup();
60 - $lang = $this->getLang();
 60+ $lang = $this->getLanguage();
6161 $list = array();
6262
6363 foreach ( $results as $result ) {
Index: trunk/extensions/AbuseFilter/AbuseFilter.class.php
@@ -163,7 +163,7 @@
164164 }
165165 }
166166
167 - $linkStr = wfMsg( 'parentheses', $context->getLang()->pipeList( $links ) );
 167+ $linkStr = wfMsg( 'parentheses', $context->getLanguage()->pipeList( $links ) );
168168 $linkStr = wfMsgExt( 'abusefilter-topnav', 'parseinline' ) . " $linkStr";
169169
170170 $linkStr = Xml::tags( 'div', array( 'class' => 'mw-abusefilter-navigation' ), $linkStr );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r103298Pass one of converting AbuseFilter to use ContextSource...johnduhart05:34, 16 November 2011
r103817Bug 29524 - Rename RequestContext::getLang to getLanguage...johnduhart16:13, 21 November 2011

Comments

#Comment by Tim Starling (talk | contribs)   05:15, 2 January 2012

Note that apart from what the commit message says, this commit also fixes a bug in AbuseFilterViewExamine::showExaminer() introduced in r103298 where $output was used for two different things at the same time.

#Comment by Dantman (talk | contribs)   06:40, 2 January 2012

IMHO this should have been done with some 1.18 compatibility in mind.

Status & tagging log