Fixed download counter for torrents (#1346)

* Fixed download counter for torrents

* Updated

* Updated

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2024-01-27 11:04:10 +07:00 committed by GitHub
commit 66b9b7bdc4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 22 additions and 14 deletions

View file

@ -957,20 +957,21 @@ function clean_username($username)
* @param bool $allow_guest
* @return mixed
*/
function get_userdata($u, bool $is_name = false, bool $allow_guest = false, bool $profile_view = false)
function get_userdata(int|string $u, bool $is_name = false, bool $allow_guest = false, bool $profile_view = false)
{
if (empty($u)) {
return false;
}
if (!$is_name) {
if ((int)$u === GUEST_UID && $allow_guest) {
$u = (int)$u;
if ($u === GUEST_UID && $allow_guest) {
if ($u_data = CACHE('bb_cache')->get('guest_userdata')) {
return $u_data;
}
}
$where_sql = "WHERE user_id = " . (int)$u;
$where_sql = "WHERE user_id = " . $u;
} else {
$where_sql = "WHERE username = '" . DB()->escape(clean_username($u)) . "'";
}
@ -993,7 +994,7 @@ function get_userdata($u, bool $is_name = false, bool $allow_guest = false, bool
return $u_data;
}
function make_jumpbox()
function make_jumpbox(): void
{
global $datastore, $template, $bb_cfg;