diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/photos.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mod/photos.php b/mod/photos.php index bbdb8b7e9..28ed609b5 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -590,6 +590,9 @@ function photos_post(&$a) { $filesize = intval($_FILES['userfile']['size']); } + + logger('photos: upload: received file: ' . $filename . ' as ' . $src . ' ' . $filesize . ' bytes', LOGGER_DEBUG); + $maximagesize = get_config('system','maximagesize'); if(($maximagesize) && ($filesize > $maximagesize)) { @@ -600,6 +603,14 @@ function photos_post(&$a) { return; } + if(! $filesize) { + notice( t('Image file is empty.') . EOL); + @unlink($src); + $foo = 0; + call_hooks('photo_post_end',$foo); + return; + } + logger('mod/photos.php: photos_post(): loading the contents of ' . $src , 'LOGGER_DEBUG'); $imagedata = @file_get_contents($src); |