mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-23 14:45:43 -07:00
Added check $bb_cfg['magnet_links_enabled'] in create_magnet() (#996)
This commit is contained in:
parent
4180543576
commit
5316a9a61e
3 changed files with 8 additions and 4 deletions
|
@ -1849,7 +1849,11 @@ function decode_text_match($txt)
|
|||
*/
|
||||
function create_magnet(string $infohash, string $infohash_v2, string $auth_key, string $name): string
|
||||
{
|
||||
global $bb_cfg, $images;
|
||||
global $bb_cfg, $images, $lang;
|
||||
|
||||
if (!$bb_cfg['magnet_links_enabled']) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Only for registered users
|
||||
if (IS_GUEST && $bb_cfg['bt_tor_browse_only_reg']) {
|
||||
|
@ -1869,7 +1873,7 @@ function create_magnet(string $infohash, string $infohash_v2, string $auth_key,
|
|||
$magnet .= 'xt=urn:btmh:1220' . bin2hex($infohash_v2);
|
||||
}
|
||||
|
||||
return '<a href="' . $magnet . '&tr=' . urlencode($bb_cfg['bt_announce_url'] . "?{$bb_cfg['passkey_key']}=$auth_key") . '&dn=' . urlencode($name) . '"><img src="' . $images['icon_magnet'] . '" width="12" height="12" border="0" /></a>';
|
||||
return '<a title="' . $lang['MAGNET'] . '" href="' . $magnet . '&tr=' . urlencode($bb_cfg['bt_announce_url'] . "?{$bb_cfg['passkey_key']}=$auth_key") . '&dn=' . urlencode($name) . '"><img src="' . $images['icon_magnet'] . '" width="12" height="12" border="0" /></a>';
|
||||
}
|
||||
|
||||
function set_die_append_msg($forum_id = null, $topic_id = null, $group_id = null)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue