r112837 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112836‎ | r112837 | r112838 >
Date:21:29, 1 March 2012
Author:ialex
Status:ok
Tags:
Comment:
* Pass number with numParams() to Message object and let that object format the number
* Added missing escaped() call from my last commit
Modified paths:
  • /trunk/phase3/includes/specials/SpecialImport.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialImport.php
@@ -352,8 +352,6 @@
353353 * @return void
354354 */
355355 function reportPage( $title, $origTitle, $revisionCount, $successCount, $pageInfo ) {
356 - global $wgContLang;
357 -
358356 $args = func_get_args();
359357 call_user_func_array( $this->mOriginalPageOutCallback, $args );
360358
@@ -364,19 +362,16 @@
365363
366364 $this->mPageCount++;
367365
368 - $localCount = $this->getLanguage()->formatNum( $successCount );
369 - $contentCount = $wgContLang->formatNum( $successCount );
370 -
371366 if( $successCount > 0 ) {
372367 $this->getOutput()->addHTML( "<li>" . Linker::linkKnown( $title ) . " " .
373 - $this->msg( 'import-revision-count', $localCount ) .
 368+ $this->msg( 'import-revision-count' )->numParams( $successCount )->escaped() .
374369 "</li>\n"
375370 );
376371
377372 $log = new LogPage( 'import' );
378373 if( $this->mIsUpload ) {
379 - $detail = $this->msg( 'import-logentry-upload-detail',
380 - $contentCount )->inContentLanguage()->text();
 374+ $detail = $this->msg( 'import-logentry-upload-detail' )->numParams(
 375+ $successCount )->inContentLanguage()->text();
381376 if ( $this->reason ) {
382377 $detail .= $this->msg( 'colon-separator' )->inContentLanguage()->text() . $this->reason;
383378 }
@@ -384,8 +379,8 @@
385380 } else {
386381 $interwiki = '[[:' . $this->mInterwiki . ':' .
387382 $origTitle->getPrefixedText() . ']]';
388 - $detail = $this->msg( 'import-logentry-interwiki-detail',
389 - $contentCount, $interwiki )->inContentLanguage()->text();
 383+ $detail = $this->msg( 'import-logentry-interwiki-detail' )->numParams(
 384+ $successCount )->params( $interwiki )->inContentLanguage()->text();
390385 if ( $this->reason ) {
391386 $detail .= $this->msg( 'colon-separator' )->inContentLanguage()->text() . $this->reason;
392387 }

Sign-offs

UserFlagDate
Nikerabbitinspected06:33, 2 March 2012

Status & tagging log