mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-20 13:24:01 -07:00
Fixed empty $auth_key after gen passkey (#670)
This commit is contained in:
parent
0fd4b733fc
commit
d6b94ac91f
4 changed files with 6 additions and 5 deletions
|
@ -1861,16 +1861,17 @@ function pad_with_space($str)
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
function create_magnet($infohash, $auth_key)
|
||||
function create_magnet($infohash, $auth_key): string
|
||||
{
|
||||
global $bb_cfg, $images, $lang, $userdata;
|
||||
|
||||
if (IS_GUEST && $bb_cfg['bt_tor_browse_only_reg']) {
|
||||
$passkey = '';
|
||||
$passkey = false;
|
||||
} elseif (empty($auth_key)) {
|
||||
if (!$passkey = \TorrentPier\Legacy\Torrent::generate_passkey($userdata['user_id'], true)) {
|
||||
bb_die($lang['PASSKEY_ERR_EMPTY']);
|
||||
}
|
||||
$auth_key = $passkey;
|
||||
} else {
|
||||
$passkey = $auth_key;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue