1
0
mirror of https://github.com/torrentpier/torrentpier.git synced 2025-03-12 04:35:42 -07:00

feat(announcer): Added event verifying ()

This commit is contained in:
Roman Kelesidis 2025-01-16 15:25:58 +03:00 committed by GitHub
parent e0456bb792
commit 6a19323138
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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);