danbooru api: fix #174, also fix for changed UploadingImageEvent
git-svn-id: file:///home/shish/svn/shimmie2/trunk@488 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
5c73eca9ed
commit
a3cec6cac9
@ -125,7 +125,7 @@ class DanbooruApi extends Extension
|
|||||||
$file = $_FILES['file']['tmp_name'];
|
$file = $_FILES['file']['tmp_name'];
|
||||||
$filename = $_FILES['file']['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
|
// 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']))
|
} elseif(isset($_REQUEST['source']))
|
||||||
{ // A url was provided
|
{ // A url was provided
|
||||||
$url = $_REQUEST['source'];
|
$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
|
// 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);
|
send_event($nevent);
|
||||||
// Did something screw up?
|
// Did something screw up?
|
||||||
if($event->vetoed) {
|
if($event->vetoed) {
|
||||||
@ -381,4 +381,5 @@ class DanbooruApi extends Extension
|
|||||||
}
|
}
|
||||||
|
|
||||||
add_event_listener(new DanbooruApi());
|
add_event_listener(new DanbooruApi());
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user