From 292c6a73a69ef85e05aa08a58406cf0cea4f5b79 Mon Sep 17 00:00:00 2001 From: shish Date: Sat, 8 Dec 2007 02:48:50 +0000 Subject: [PATCH] handle errors in the add-to-database part of uploads (eg hash collisons) git-svn-id: file:///home/shish/svn/shimmie2/trunk@633 7f39781d-f577-437e-ae19-be835c7a54ca --- ext/handle_pixel/main.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ext/handle_pixel/main.php b/ext/handle_pixel/main.php index 12e2c61b..b5e40bdd 100644 --- a/ext/handle_pixel/main.php +++ b/ext/handle_pixel/main.php @@ -24,7 +24,13 @@ class PixelFileHandler extends Extension { $event->veto("Pixel Handler failed to create image object from data"); return; } - send_event(new ImageAdditionEvent($event->user, $image)); + + $iae = new ImageAdditionEvent($event->user, $image); + send_event($iae); + if($iae->vetoed) { + $event->veto($iae->veto_reason); + return; + } } if(is_a($event, 'ThumbnailGenerationEvent') && $this->supported_ext($event->type)) {