From 4ca6a9a38257a8f8c82842ce734ae946b90ebb4c Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 28 Jun 2011 18:59:41 -0700 Subject: dbg info for photo uploads --- mod/photos.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'mod/photos.php') 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); -- cgit v1.2.3