not all imageinfoset events have favorite_action

This commit is contained in:
Shish 2010-07-26 23:06:12 +01:00
parent c9ce99bc96
commit c78aa580c0

View file

@ -77,7 +77,10 @@ class Favorites extends SimpleExtension {
public function onImageInfoSet($event) { public function onImageInfoSet($event) {
global $user; global $user;
if(($_POST['favorite_action'] == "set") || ($_POST['favorite_action'] == "unset")) { if(
in_array('favorite_action', $_POST) &&
(($_POST['favorite_action'] == "set") || ($_POST['favorite_action'] == "unset"))
) {
send_event(new FavoriteSetEvent($event->image_id, $user, ($_POST['favorite_action'] == "set"))); send_event(new FavoriteSetEvent($event->image_id, $user, ($_POST['favorite_action'] == "set")));
} }
} }