From edec5482191cfa396c6ce1114f5da54fa759a130 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sat, 18 Nov 2023 20:33:45 +0700 Subject: [PATCH] Removed one-time used variables (#1120) --- src/Legacy/Torrent.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Legacy/Torrent.php b/src/Legacy/Torrent.php index e02510168..14a488724 100644 --- a/src/Legacy/Torrent.php +++ b/src/Legacy/Torrent.php @@ -541,19 +541,15 @@ class Torrent } } - // Announce URL - $ann_url = $bb_cfg['bt_announce_url']; - + // Torrent decoding $file_contents = file_get_contents($filename); if (!$tor = \Arokettu\Bencode\Bencode::decode($file_contents, dictType: \Arokettu\Bencode\Bencode\Collection::ARRAY)) { bb_die($lang['TORFILE_INVALID']); } - $announce = $bb_cfg['ocelot']['enabled'] ? (string)($bb_cfg['ocelot']['url'] . $passkey_val . "/announce") : (string)($ann_url . "?$passkey_key=$passkey_val"); - // Replace original announce url with tracker default if ($bb_cfg['bt_replace_ann_url'] || !isset($tor['announce'])) { - $tor['announce'] = $announce; + $tor['announce'] = $bb_cfg['ocelot']['enabled'] ? $bb_cfg['ocelot']['url'] . "$passkey_val/announce" : $bb_cfg['bt_announce_url'] . "?$passkey_key=$passkey_val"; } // Get additional announce urls