* (bug 9447) Added hooks for search result headings
* Image redirects are now enabled
* (bug 13450) Email confirmation can now be canceled before the expiration
-
+* (bug 13490) Show upload/file size limit on upload form
=== Bug fixes in 1.13 ===
* @access private
*/
function mainUploadForm( $msg='' ) {
- global $wgOut, $wgUser;
+ global $wgOut, $wgUser, $wgLang, $wgMaxUploadSize;
global $wgUseCopyrightUpload, $wgUseAjax, $wgAjaxUploadDestCheck, $wgAjaxLicensePreview;
global $wgRequest, $wgAllowCopyUploads;
global $wgStylePath, $wgStyleVersion;
}
}
+ # Get the maximum file size from php.ini as $wgMaxUploadSize works for uploads from URL via CURL only
+ # See http://de.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 = ( 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;
+ }
+ $val2 = $wgAllowCopyUploads ? min( $wgMaxUploadSize, $val2 ) : $val2;
+ $maxUploadSize = wfMsgExt( 'upload-maxfilesize', 'parseinline', $wgLang->formatSize( $val2 ) );
+
$sourcefilename = wfMsgExt( 'sourcefilename', 'escapenoentities' );
$destfilename = wfMsgExt( 'destfilename', 'escapenoentities' );
$summary = wfMsgExt( 'fileuploadsummary', 'parseinline' );
<tr>
<td></td>
<td>
+ {$maxUploadSize}
{$extensionsList}
</td>
</tr>
'uploadvirus' => 'Diese Datei enthält einen Virus! Details: $1',
'sourcefilename' => 'Quelldatei:',
'destfilename' => 'Zielname:',
+'upload-maxfilesize' => 'Maximale Dateigröße: $1',
'watchthisupload' => 'Diese Seite beobachten',
'filewasdeleted' => 'Eine Datei mit diesem Namen wurde schon einmal hochgeladen und zwischenzeitlich wieder gelöscht. Bitte prüfe zuerst den Eintrag im $1, bevor du die Datei wirklich speicherst.',
'upload-wasdeleted' => "'''Achtung: Du lädst eine Datei hoch, die bereits früher gelöscht wurde.'''
'uploadvirus' => 'The file contains a virus! Details: $1',
'sourcefilename' => 'Source filename:',
'destfilename' => 'Destination filename:',
+'upload-maxfilesize' => 'Maximum file size: $1',
'watchthisupload' => 'Watch this page',
'filewasdeleted' => 'A file of this name has been previously uploaded and subsequently deleted. You should check the $1 before proceeding to upload it again.',
'upload-wasdeleted' => "'''Warning: You are uploading a file that was previously deleted.'''