Use one GET variable for filelisting (#1193)

This commit is contained in:
Cønstantine Kovalensky 2023-12-06 14:25:25 +04:00 committed by GitHub
commit 13001d42d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 2 deletions

View file

@ -215,6 +215,7 @@ if ($tor_reged && $tor_info) {
'MAGNET' => $tor_magnet, 'MAGNET' => $tor_magnet,
'HASH' => !empty($tor_info['info_hash']) ? strtoupper(bin2hex($tor_info['info_hash'])) : false, 'HASH' => !empty($tor_info['info_hash']) ? strtoupper(bin2hex($tor_info['info_hash'])) : false,
'HASH_V2' => !empty($tor_info['info_hash_v2']) ? strtoupper(bin2hex($tor_info['info_hash_v2'])) : false, 'HASH_V2' => !empty($tor_info['info_hash_v2']) ? strtoupper(bin2hex($tor_info['info_hash_v2'])) : false,
'FILELIST_LINK' => !empty($tor_info['info_hash_v2']) ? (FILELIST_URL . $tor_info['topic_id']) : false,
'REGED_TIME' => bb_date($tor_info['reg_time']), 'REGED_TIME' => bb_date($tor_info['reg_time']),
'REGED_DELTA' => delta_time($tor_info['reg_time']), 'REGED_DELTA' => delta_time($tor_info['reg_time']),
'TORRENT_SIZE' => humn_size($tor_size), 'TORRENT_SIZE' => humn_size($tor_size),

View file

@ -19,7 +19,7 @@ if ($bb_cfg['bt_disable_dht'] && IS_GUEST) {
die($lang['BT_PRIVATE_TRACKER']); die($lang['BT_PRIVATE_TRACKER']);
} }
$topic_id = !empty($_GET['topic']) ? (int)$_GET['topic'] : (http_response_code(404) && die($lang['INVALID_TOPIC_ID'])); $topic_id = !empty($_GET['filelist']) ? (int)$_GET['filelist'] : (http_response_code(404) && die($lang['INVALID_TOPIC_ID']));
$sql = 'SELECT t.attach_id, t.info_hash_v2, t.size, ad.physical_filename $sql = 'SELECT t.attach_id, t.info_hash_v2, t.size, ad.physical_filename
FROM ' . BB_BT_TORRENTS . ' t FROM ' . BB_BT_TORRENTS . ' t

View file

@ -296,6 +296,7 @@ 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', 'viewtopic.php?filelist=');
define('USER_AGENT', strtolower($_SERVER['HTTP_USER_AGENT'])); define('USER_AGENT', strtolower($_SERVER['HTTP_USER_AGENT']));

View file

@ -171,7 +171,7 @@
<p class="small">{postrow.attach.tor_reged.FILESIZE}</p> <p class="small">{postrow.attach.tor_reged.FILESIZE}</p>
<p style="padding-top: 6px;"><input id="tor-filelist-btn" type="button" class="lite" value="{L_FILELIST}" /></p> <p style="padding-top: 6px;"><input id="tor-filelist-btn" type="button" class="lite" value="{L_FILELIST}" /></p>
<!-- IF postrow.attach.tor_reged.HASH_V2 --> <!-- IF postrow.attach.tor_reged.HASH_V2 -->
<p><a href="{FULL_URL}viewtopic.php?filelist&topic={TOPIC_ID}" title = "File hashes | .torrent meta-info" target="_blank">...</a></p> <p><a href="{postrow.attach.tor_reged.FILELIST_LINK}" title = "File hashes | .torrent meta-info" target="_blank">...</a></p>
<!-- ENDIF --> <!-- ENDIF -->
</td> </td>
</tr> </tr>