From: Benjamin Lees Date: Wed, 5 Aug 2009 04:27:19 +0000 (+0000) Subject: Convert check to use wfShorthandToInteger() X-Git-Tag: 1.31.0-rc.0~40486 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/%7B%7B%20url_for%28%27admin_users%27%29%20%7D%7D?a=commitdiff_plain;h=2707614590b7cdeba8a4b13cc44dadbfa8e07fe1;p=lhc%2Fweb%2Fwiklou.git Convert check to use wfShorthandToInteger() --- diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index 91456f072b..277dfde885 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -735,21 +735,7 @@ wgUploadAutoFill = {$autofill}; # Get the maximum file size from php.ini as $wgMaxUploadSize works for uploads from URL via CURL only # See http://www.php.net/manual/en/ini.core.php#ini.upload-max-filesize for possible values of upload_max_filesize - $val = trim( ini_get( 'upload_max_filesize' ) ); - $last = strtoupper( ( substr( $val, -1 ) ) ); - switch( $last ) { - case 'G': - $val2 = substr( $val, 0, -1 ) * 1024 * 1024 * 1024; - break; - case 'M': - $val2 = substr( $val, 0, -1 ) * 1024 * 1024; - break; - case 'K': - $val2 = substr( $val, 0, -1 ) * 1024; - break; - default: - $val2 = $val; - } + $val = wfShorthandToInteger( ini_get( 'upload_max_filesize' ) ); $maxUploadSize = '
' . wfMsgExt( 'upload-maxfilesize', array( 'parseinline', 'escapenoentities' ), $wgLang->formatSize( $val2 ) ) .