Block uploading more than one torrent file (#1293)

This commit is contained in:
Roman Kelesidis 2023-12-31 01:25:45 +07:00 committed by GitHub
commit 09f352d2dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 .= '<br />';
}
$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)) {