From 99766eefafaf33008b080a7a0d9173c3871037a2 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 15 Nov 2009 16:31:19 +0100 Subject: don't check filesize but rely on error on upload FS#1716 Ignore-this: adff36f3e49963a6682b5faabf6cb63e darcs-hash:20091115153119-7ad00-2c20c420faeea08c113a76acc05917621f361880.gz --- lib/exe/mediamanager.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/exe/mediamanager.php b/lib/exe/mediamanager.php index 7ad2f326c..471bd28ea 100644 --- a/lib/exe/mediamanager.php +++ b/lib/exe/mediamanager.php @@ -54,14 +54,17 @@ } // give info on PHP catched upload errors - if($_FILES['upload']['error']) switch($_FILES['upload']['error']){ - case 1: - case 2: - msg(sprintf($lang['uploadsize'], - filesize_h(php_to_byte(ini_get('upload_max_filesize')))),-1); - break; - default: - msg($lang['uploadfail'],-1); + if($_FILES['upload']['error']){ + switch($_FILES['upload']['error']){ + case 1: + case 2: + msg(sprintf($lang['uploadsize'], + filesize_h(php_to_byte(ini_get('upload_max_filesize')))),-1); + break; + default: + msg($lang['uploadfail'].' ('.$_FILES['upload']['error'].')',-1); + } + unset($_FILES['upload']); } // handle upload -- cgit v1.2.3