r109549 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109548‎ | r109549 | r109550 >
Date:16:44, 19 January 2012
Author:reedy
Status:resolved
Tags:
Comment:
* (bug 33819) Display filesize on Special:NewFiles in appropriate unit.

Do the same for the rest of the file usages of 'nbytes' in Generic.php
Modified paths:
  • /trunk/phase3/includes/media/Generic.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/media/Generic.php
@@ -404,7 +404,8 @@
405405 * @return string
406406 */
407407 function getShortDesc( $file ) {
408 - return wfMessage( 'nbytes' )->numParams( $file->getSize() )->escaped();
 408+ global $wgLang;
 409+ return $wgLang->formatSize( $file->getSize() );
409410 }
410411
411412 /**
@@ -422,7 +423,8 @@
423424 * @return string
424425 */
425426 static function getGeneralShortDesc( $file ) {
426 - return wfMessage( 'nbytes' )->numParams( $file->getSize() )->escaped();
 427+ global $wgLang;
 428+ return $wgLang->formatSize( $file->getSize() );
427429 }
428430
429431 /**
@@ -707,7 +709,8 @@
708710 * @return string
709711 */
710712 function getShortDesc( $file ) {
711 - $nbytes = wfMessage( 'nbytes' )->numParams( $file->getSize() )->escaped();
 713+ global $wgLang;
 714+ $nbytes = $wgLang->formatSize( $file->getSize() );
712715 $widthheight = wfMessage( 'widthheight' )->numParams( $file->getWidth(), $file->getHeight() )->escaped();
713716
714717 return "$widthheight ($nbytes)";

Follow-up revisions

RevisionCommit summaryAuthorDate
r109550Add some escaping to r109547, 109548, 109549...reedy16:55, 19 January 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r109547* (bug 33819) Display filesize on Special:NewFiles in appropriate unit.reedy16:37, 19 January 2012

Status & tagging log