From fd85c83700e24727aa235311347e71c8cfa91258 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Thu, 31 Mar 2005 12:23:23 +0000 Subject: [PATCH] * Changed $wgUploadSizeWarning from 1.5 * 10^5 to 150 * 2^10 * The largefile message now displays $wgUploadSizeWarning --- includes/DefaultSettings.php | 2 +- includes/SpecialUpload.php | 4 +++- languages/Language.php | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index b8101d5fa2..73c858a730 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -777,7 +777,7 @@ $wgCheckFileExtensions = true; $wgStrictFileExtensions = true; /** Warn if uploaded files are larger than this */ -$wgUploadSizeWarning = 150000; +$wgUploadSizeWarning = 150 * 1024; /** For compatibility with old installations set to false */ $wgPasswordSalt = true; diff --git a/includes/SpecialUpload.php b/includes/SpecialUpload.php index c9789212e9..b3a8f6349d 100644 --- a/includes/SpecialUpload.php +++ b/includes/SpecialUpload.php @@ -231,7 +231,9 @@ class UploadForm { global $wgUploadSizeWarning; if ( $wgUploadSizeWarning && ( $this->mUploadSize > $wgUploadSizeWarning ) ) { - $warning .= '
  • '.wfMsg( 'largefile' ).'
  • '; + # TODO: Format $wgUploadSizeWarning to something that looks better than the raw byte + # value, perhaps add GB,MB and KB suffixes? + $warning .= '
  • '.wfMsg( 'largefile', $wgUploadSizeWarning ).'
  • '; } if ( $this->mUploadSize == 0 ) { $warning .= '
  • '.wfMsg( 'emptyfile' ).'
  • '; diff --git a/languages/Language.php b/languages/Language.php index a4ca3df982..e6de493228 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -1011,7 +1011,7 @@ agrees to license it under the terms of the $1.", 'illegalfilename' => 'The filename "$1" contains characters that are not allowed in page titles. Please rename the file and try uploading it again.', 'badfilename' => "Image name has been changed to \"$1\".", 'badfiletype' => "\".$1\" is not a recommended image file format.", -'largefile' => 'It is recommended that images not exceed 100k in size.', +'largefile' => 'It is recommended that images not exceed $1 bytes in size.', 'emptyfile' => 'The file you uploaded seems to be empty. This might be due to a typo in the file name. Please check whether you really want to upload this file.', 'fileexists' => 'A file with this name exists already, please check $1 if you are not sure if you want to change it.', 'successfulupload' => 'Successful upload', -- 2.20.1