diff options
author | Andreas Gohr <andi@splitbrain.org> | 2009-11-15 16:31:19 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2009-11-15 16:31:19 +0100 |
commit | 99766eefafaf33008b080a7a0d9173c3871037a2 (patch) | |
tree | 3ea1198d8e110244bcd850b678c0bcfb02b65b3a | |
parent | 86d5158398ea947260e756b80b8217878a17420b (diff) | |
download | rpg-99766eefafaf33008b080a7a0d9173c3871037a2.tar.gz rpg-99766eefafaf33008b080a7a0d9173c3871037a2.tar.bz2 |
don't check filesize but rely on error on upload FS#1716
Ignore-this: adff36f3e49963a6682b5faabf6cb63e
darcs-hash:20091115153119-7ad00-2c20c420faeea08c113a76acc05917621f361880.gz
-rw-r--r-- | inc/media.php | 7 | ||||
-rw-r--r-- | lib/exe/mediamanager.php | 19 |
2 files changed, 13 insertions, 13 deletions
diff --git a/inc/media.php b/inc/media.php index d8ca288c1..3850f4e33 100644 --- a/inc/media.php +++ b/inc/media.php @@ -239,11 +239,8 @@ function media_upload($ns,$auth){ $file = $_FILES['upload']; if(empty($id)) $id = $file['name']; - // check for data - if(!@filesize($file['tmp_name'])){ - msg('No data uploaded. Disk full?',-1); - return false; - } + // check for errors (messages are done in lib/exe/mediamanager.php) + if($file['error']) return false; // check extensions list($fext,$fmime,$dl) = mimetype($file['name']); 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 |