From 09f352d2ddb9c3143ed75f9d005c24f94e1190fe Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sun, 31 Dec 2023 01:25:45 +0700 Subject: [PATCH] Block uploading more than one torrent file (#1293) --- src/Legacy/Attach.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Legacy/Attach.php b/src/Legacy/Attach.php index 791851d27..9b45034fe 100644 --- a/src/Legacy/Attach.php +++ b/src/Legacy/Attach.php @@ -824,9 +824,17 @@ class Attach } //bt + // Block uploading more than one torrent file + global $update_attachment; + if (!$error && !$update_attachment && $this->extension === TORRENT_EXT && in_array(TORRENT_EXT, $this->attachment_extension_list)) { + $error = true; + if (!empty($error_msg)) { + $error_msg .= '
'; + } + $error_msg .= $lang['ONLY_1_TOR_PER_TOPIC']; + } // Check if user can post torrent global $post_data; - if (!$error && $this->extension === TORRENT_EXT && !$post_data['first_post']) { $error = true; if (!empty($error_msg)) {