r54428 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54427‎ | r54428 | r54429 >
Date:04:27, 5 August 2009
Author:emufarmers
Status:resolved
Tags:
Comment:
Convert check to use wfShorthandToInteger()
Modified paths:
  • /trunk/phase3/includes/specials/SpecialUpload.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialUpload.php
@@ -735,21 +735,7 @@
736736
737737 # Get the maximum file size from php.ini as $wgMaxUploadSize works for uploads from URL via CURL only
738738 # See http://www.php.net/manual/en/ini.core.php#ini.upload-max-filesize for possible values of upload_max_filesize
739 - $val = trim( ini_get( 'upload_max_filesize' ) );
740 - $last = strtoupper( ( substr( $val, -1 ) ) );
741 - switch( $last ) {
742 - case 'G':
743 - $val2 = substr( $val, 0, -1 ) * 1024 * 1024 * 1024;
744 - break;
745 - case 'M':
746 - $val2 = substr( $val, 0, -1 ) * 1024 * 1024;
747 - break;
748 - case 'K':
749 - $val2 = substr( $val, 0, -1 ) * 1024;
750 - break;
751 - default:
752 - $val2 = $val;
753 - }
 739+ $val = wfShorthandToInteger( ini_get( 'upload_max_filesize' ) );
754740 $maxUploadSize = '<div id="mw-upload-maxfilesize">' .
755741 wfMsgExt( 'upload-maxfilesize', array( 'parseinline', 'escapenoentities' ),
756742 $wgLang->formatSize( $val2 ) ) .

Follow-up revisions

RevisionCommit summaryAuthorDate
r54510* <b>Notice</b>: Undefined variable: val2 in <b>/var/www/sandwiki/includes/s...nikerabbit09:45, 6 August 2009

Status & tagging log