Index: trunk/phase3/CREDITS |
— | — | @@ -67,6 +67,7 @@ |
68 | 68 | * Daniel Arnold |
69 | 69 | * Danny B. |
70 | 70 | * Derk-Jan Hartman |
| 71 | +* Emufarmers |
71 | 72 | * FunPika |
72 | 73 | * Happy-melon |
73 | 74 | * Jeremy Baron |
Index: trunk/phase3/includes/specials/SpecialUpload.php |
— | — | @@ -1047,26 +1047,29 @@ |
1048 | 1048 | } |
1049 | 1049 | |
1050 | 1050 | # Get the maximum file size from php.ini as $wgMaxUploadSize works for uploads from URL via CURL only |
1051 | | - # See http://www.php.net/manual/en/ini.core.php#ini.upload-max-filesize for possible values of upload_max_filesize |
1052 | | - $val = trim( ini_get( 'upload_max_filesize' ) ); |
1053 | | - $last = strtoupper( ( substr( $val, -1 ) ) ); |
1054 | | - switch( $last ) { |
1055 | | - case 'G': |
1056 | | - $val2 = substr( $val, 0, -1 ) * 1024 * 1024 * 1024; |
1057 | | - break; |
1058 | | - case 'M': |
1059 | | - $val2 = substr( $val, 0, -1 ) * 1024 * 1024; |
1060 | | - break; |
1061 | | - case 'K': |
1062 | | - $val2 = substr( $val, 0, -1 ) * 1024; |
1063 | | - break; |
1064 | | - default: |
1065 | | - $val2 = $val; |
| 1051 | + # See http://www.php.net/manual/en/faq.using.php#faq.using.shorthandbytes for possible values of upload_max_filesize and post_max_filesize |
| 1052 | + $max_sizes = array(); |
| 1053 | + $max_sizes[] = trim( ini_get( 'upload_max_filesize' ) ); |
| 1054 | + $max_sizes[] = trim( ini_get( 'post_max_size' ) ); |
| 1055 | + foreach( $max_sizes as &$size) { |
| 1056 | + $last = strtoupper( substr( $size, -1 ) ); |
| 1057 | + switch( $last ) { |
| 1058 | + case 'G': |
| 1059 | + $size = substr( $size, 0, -1 ) * 1024 * 1024 * 1024; |
| 1060 | + break; |
| 1061 | + case 'M': |
| 1062 | + $size = substr( $size, 0, -1 ) * 1024 * 1024; |
| 1063 | + break; |
| 1064 | + case 'K': |
| 1065 | + $size = substr( $size, 0, -1 ) * 1024; |
| 1066 | + break; |
| 1067 | + } |
1066 | 1068 | } |
1067 | | - $val2 = $wgAllowCopyUploads ? min( $wgMaxUploadSize, $val2 ) : $val2; |
| 1069 | + $val = min( $max_sizes[0], $max_sizes[1] ); |
| 1070 | + $val = $wgAllowCopyUploads ? min( $wgMaxUploadSize, $val ) : $val; |
1068 | 1071 | $maxUploadSize = '<div id="mw-upload-maxfilesize">' . |
1069 | 1072 | wfMsgExt( 'upload-maxfilesize', array( 'parseinline', 'escapenoentities' ), |
1070 | | - $wgLang->formatSize( $val2 ) ) . |
| 1073 | + $wgLang->formatSize( $val ) ) . |
1071 | 1074 | "</div>\n"; |
1072 | 1075 | |
1073 | 1076 | $sourcefilename = wfMsgExt( 'sourcefilename', array( 'parseinline', 'escapenoentities' ) ); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -53,6 +53,7 @@ |
54 | 54 | Mediawiki Namespace, before checking the message files |
55 | 55 | * (bug 18466) Add note or warning when overruling a move (semi-)protection |
56 | 56 | * (bug 18342) insertTags works in edit summary box |
| 57 | +* (bug 18411) The upload form also checks post_max_size |
57 | 58 | |
58 | 59 | === Bug fixes in 1.16 === |
59 | 60 | |