mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-12 17:47:30 -07:00
feat(announcer): Added event
verifying (#1765)
This commit is contained in:
parent
e0456bb792
commit
6a19323138
1 changed files with 10 additions and 0 deletions
|
@ -94,6 +94,16 @@ if (!isset($info_hash)) {
|
||||||
msg_die('info_hash was not provided');
|
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
|
// Store info hash in hex format
|
||||||
$info_hash_hex = bin2hex($info_hash);
|
$info_hash_hex = bin2hex($info_hash);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue