not all imageinfoset events have favorite_action
This commit is contained in:
parent
c9ce99bc96
commit
c78aa580c0
1 changed files with 4 additions and 1 deletions
|
@ -77,7 +77,10 @@ class Favorites extends SimpleExtension {
|
|||
|
||||
public function onImageInfoSet($event) {
|
||||
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")));
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue