Minor improvements

This commit is contained in:
Roman Kelesidis 2024-04-02 17:26:07 +07:00
commit 0fb68f5042
2 changed files with 2 additions and 4 deletions

View file

@ -16,7 +16,7 @@ if ($bb_cfg['bt_disable_dht'] && IS_GUEST) {
bb_simple_die($lang['BT_PRIVATE_TRACKER'], 403); bb_simple_die($lang['BT_PRIVATE_TRACKER'], 403);
} }
$topic_id = !empty($_GET['topic']) ? (int)$_GET['topic'] : false; $topic_id = isset($_GET[POST_TOPIC_URL]) ? (int)$_GET[POST_TOPIC_URL] : 0;
if (!$topic_id) { if (!$topic_id) {
bb_simple_die($lang['INVALID_TOPIC_ID'], 404); bb_simple_die($lang['INVALID_TOPIC_ID'], 404);
@ -28,7 +28,6 @@ $sql = 'SELECT t.attach_id, t.info_hash, t.info_hash_v2, t.size, ad.physical_fil
ON t.attach_id = ad.attach_id ON t.attach_id = ad.attach_id
WHERE t.topic_id = ' . $topic_id . ' WHERE t.topic_id = ' . $topic_id . '
LIMIT 1'; LIMIT 1';
$row = DB()->fetch_row($sql); $row = DB()->fetch_row($sql);
if (empty($row['physical_filename'])) { if (empty($row['physical_filename'])) {

View file

@ -299,12 +299,11 @@ define('POSTING_URL', $bb_cfg['posting_url']);
define('PROFILE_URL', 'profile.php?mode=viewprofile&u='); define('PROFILE_URL', 'profile.php?mode=viewprofile&u=');
define('BONUS_URL', 'profile.php?mode=bonus'); define('BONUS_URL', 'profile.php?mode=bonus');
define('TOPIC_URL', 'viewtopic.php?t='); define('TOPIC_URL', 'viewtopic.php?t=');
define('FILELIST_URL', 'filelist.php?topic='); define('FILELIST_URL', 'filelist.php?t=');
define('USER_AGENT', strtolower($_SERVER['HTTP_USER_AGENT'])); define('USER_AGENT', strtolower($_SERVER['HTTP_USER_AGENT']));
define('HTML_SELECT_MAX_LENGTH', 60); define('HTML_SELECT_MAX_LENGTH', 60);
define('HTML_WBR_LENGTH', 12);
define('HTML_CHECKED', ' checked '); define('HTML_CHECKED', ' checked ');
define('HTML_DISABLED', ' disabled '); define('HTML_DISABLED', ' disabled ');