not all imageinfoset events have favorite_action
This commit is contained in:
		
							parent
							
								
									c9ce99bc96
								
							
						
					
					
						commit
						c78aa580c0
					
				| @ -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"))); | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user