diff options
| author | Bharat Mediratta <bharat@menalto.com> | 2009-06-08 08:48:42 +0800 |
|---|---|---|
| committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-06-09 14:17:26 +0800 |
| commit | bb844c1139c84090b446e50234f64063365affc3 (patch) | |
| tree | d447c9ff6ad6d5603ce99ebd7ddd37ad2b217445 /modules/gallery/helpers/photo.php | |
| parent | a3344814d7bc22bd6a7e55b9a9174fd202ef79f2 (diff) | |
Improve error handling support for corrupt images and report them
appropriately in g2_import.
Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
Diffstat (limited to 'modules/gallery/helpers/photo.php')
| -rw-r--r-- | modules/gallery/helpers/photo.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/gallery/helpers/photo.php b/modules/gallery/helpers/photo.php index c1c005f5..a4bc853b 100644 --- a/modules/gallery/helpers/photo.php +++ b/modules/gallery/helpers/photo.php @@ -53,6 +53,10 @@ class photo_Core { throw new Exception("@todo NAME_CANNOT_END_IN_PERIOD"); } + if (filesize($filename) == 0) { + throw new Exception("@todo EMPTY_INPUT_FILE"); + } + $image_info = getimagesize($filename); // Force an extension onto the name |
