From ec6e7e81913bed3cf625bee39cb358c7fecd0da6 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Wed, 30 Jul 2025 10:12:14 +0300 Subject: [PATCH] Update displaying_torrent.php --- library/attach_mod/displaying_torrent.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/library/attach_mod/displaying_torrent.php b/library/attach_mod/displaying_torrent.php index ce6bf669a..10dab59af 100644 --- a/library/attach_mod/displaying_torrent.php +++ b/library/attach_mod/displaying_torrent.php @@ -66,6 +66,7 @@ $tracker_status = $attachments['_' . $post_id][$i]['tracker_status']; $download_count = declension((int)$attachments['_' . $post_id][$i]['download_count'], 'times'); $tor_file_size = humn_size($attachments['_' . $post_id][$i]['filesize']); $tor_file_time = bb_date($attachments['_' . $post_id][$i]['filetime']); +$real_filename = clean_filename(basename($attachments['_' . $post_id][$i]['real_filename'])); $tor_reged = (bool)$tracker_status; $show_peers = (bool)$bb_cfg['bt_show_peers']; @@ -88,10 +89,14 @@ if ($tor_auth_reg || $tor_auth_del) { $tracker_link = ($tor_reged) ? $unreg_tor_url : $reg_tor_url; } -if ($bb_cfg['tracker']['use_old_torrent_name_format']) { - $display_name = '[' . $bb_cfg['server_name'] . '].t' . $bt_topic_id . '.' . TORRENT_EXT; +if ($bb_cfg['tracker']['use_real_filename']) { + $display_name = $real_filename; } else { - $display_name = $t_data['topic_title'] . ' [' . $bb_cfg['server_name'] . '-' . $bt_topic_id . ']' . '.' . TORRENT_EXT; + if ($bb_cfg['tracker']['use_old_torrent_name_format']) { + $display_name = '[' . $bb_cfg['server_name'] . '].t' . $bt_topic_id . '.' . TORRENT_EXT; + } else { + $display_name = $t_data['topic_title'] . ' [' . $bb_cfg['server_name'] . '-' . $bt_topic_id . ']' . '.' . TORRENT_EXT; + } } if (!$tor_reged) {