From a3cec6cac90ddf8c5789054f5da917d0bc111c32 Mon Sep 17 00:00:00 2001 From: jjs Date: Thu, 30 Aug 2007 14:01:36 +0000 Subject: [PATCH] danbooru api: fix #174, also fix for changed UploadingImageEvent git-svn-id: file:///home/shish/svn/shimmie2/trunk@488 7f39781d-f577-437e-ae19-be835c7a54ca --- contrib/danbooru_api/main.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/contrib/danbooru_api/main.php b/contrib/danbooru_api/main.php index e99e6121..a2107c1a 100644 --- a/contrib/danbooru_api/main.php +++ b/contrib/danbooru_api/main.php @@ -125,7 +125,7 @@ class DanbooruApi extends Extension $file = $_FILES['file']['tmp_name']; $filename = $_FILES['file']['name']; // If both a file is posted and a source provided, I'm assuming source is the source of the file - $source = isset($_REQUEST['source']) ? $_REQUEST['source'] : ""; + $source = (isset($_REQUEST['source']) && !empty($_REQUEST['source'])) ? $_REQUEST['source'] : null; } elseif(isset($_REQUEST['source'])) { // A url was provided $url = $_REQUEST['source']; @@ -212,7 +212,7 @@ class DanbooruApi extends Extension } // Fire off an event which should process the new image and add it to the db - $nevent = new UploadingImageEvent($image); + $nevent = new UploadingImageEvent($user, $image); send_event($nevent); // Did something screw up? if($event->vetoed) { @@ -381,4 +381,5 @@ class DanbooruApi extends Extension } add_event_listener(new DanbooruApi()); -?> \ No newline at end of file +?> +