From 1ce5edf531886230b0c85e0b433b0dc6f4f0765d Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sun, 10 Sep 2023 00:36:13 +0700 Subject: [PATCH] Fixed null variables Co-Authored-By: Constantine Kovalensky <45331093+kovalensky@users.noreply.github.com> --- bt/announce.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bt/announce.php b/bt/announce.php index d75b5d383..d06717db6 100644 --- a/bt/announce.php +++ b/bt/announce.php @@ -170,20 +170,20 @@ if ($lp_info) { "; $row = DB()->fetch_row($sql); + // Verify if torrent registered on tracker and user authorized + if (empty($row['topic_id'])) { + msg_die('Torrent not registered, info_hash = ' . bin2hex($info_hash)); + } + if (empty($row['user_id'])) { + msg_die('Please LOG IN and RE-DOWNLOAD this torrent (user not found)'); + } + // Assign variables $user_id = $row['user_id']; $topic_id = $row['topic_id']; $releaser = (int)($user_id == $row['poster_id']); $tor_type = $row['tor_type']; - // Verify if torrent registered on tracker and user authorized - if (empty($topic_id)) { - msg_die('Torrent not registered, info_hash = ' . bin2hex($info_hash)); - } - if (empty($user_id)) { - msg_die('Please LOG IN and RE-DOWNLOAD this torrent (user not found)'); - } - // Check hybrid torrents $is_hybrid = false; if (!empty($row['info_hash']) && !empty($row['info_hash_v2'])) {