diff options
author | Andreas Gohr <andi@splitbrain.org> | 2008-07-15 23:53:45 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2008-07-15 23:53:45 +0200 |
commit | 9676dc23466e3c707ecbf594aaa4dc89bfecafd2 (patch) | |
tree | 8cca1256af2ab7b10100ed3cca29a78a8c7c74e2 | |
parent | 24297a695f52a061e471dbeacae874acda5a0e68 (diff) | |
download | rpg-9676dc23466e3c707ecbf594aaa4dc89bfecafd2.tar.gz rpg-9676dc23466e3c707ecbf594aaa4dc89bfecafd2.tar.bz2 |
Check file size of uploaded data
This will abort the upload process when the uploaded temp file has zero bytes.
This can occur when the disk is full.
darcs-hash:20080715215345-7ad00-1a2b45b77d59b1b39d0133ec1737dbb0054368c1.gz
-rw-r--r-- | inc/media.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/inc/media.php b/inc/media.php index aa29c0d7d..e8a19caf9 100644 --- a/inc/media.php +++ b/inc/media.php @@ -215,6 +215,12 @@ 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 extensions list($fext,$fmime) = mimetype($file['name']); list($iext,$imime) = mimetype($id); |