mirror of
https://github.com/torrentpier/torrentpier.git
synced 2025-03-12 04:35:42 -07:00
feat(announcer): Added event
verifying (#1765)
This commit is contained in:
parent
e0456bb792
commit
6a19323138
@ -94,6 +94,16 @@ if (!isset($info_hash)) {
|
||||
msg_die('info_hash was not provided');
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify event
|
||||
*
|
||||
* @see https://github.com/HDInnovations/UNIT3D-Community-Edition/blob/c64275f0b5dcb3c4c845d5204871adfe24f359d6/app/Http/Controllers/AnnounceController.php#L275
|
||||
*/
|
||||
$event = strtolower($event);
|
||||
if (!in_array($event, ['started', 'completed', 'stopped', 'paused', ''])) {
|
||||
msg_die('Invalid event: ' . $event);
|
||||
}
|
||||
|
||||
// Store info hash in hex format
|
||||
$info_hash_hex = bin2hex($info_hash);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user