Index: trunk/phase3/includes/specials/SpecialUpload.php |
— | — | @@ -735,21 +735,7 @@ |
736 | 736 | |
737 | 737 | # Get the maximum file size from php.ini as $wgMaxUploadSize works for uploads from URL via CURL only |
738 | 738 | # 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' ) ); |
754 | 740 | $maxUploadSize = '<div id="mw-upload-maxfilesize">' . |
755 | 741 | wfMsgExt( 'upload-maxfilesize', array( 'parseinline', 'escapenoentities' ), |
756 | 742 | $wgLang->formatSize( $val2 ) ) . |