Minor improvements (#1228)

This commit is contained in:
Roman Kelesidis 2023-12-20 09:00:02 +07:00 committed by GitHub
commit f4e0152d4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -489,15 +489,6 @@ class User
if ($c_sdata_curr !== $c_sdata_resv) {
bb_setcookie(COOKIE_DATA, $c_sdata_curr, httponly: true);
}
// Unset sql debug cookies
if (!SQL_DEBUG || !APP_DEBUG) {
foreach (array('explain', 'sql_log', 'sql_log_full') as $cookie) {
if (isset($_COOKIE[$cookie])) {
bb_setcookie($cookie, null);
}
}
}
}
}
@ -510,7 +501,7 @@ class User
*
* @return bool|string
*/
public function verify_autologin_id($userdata, $expire_check = false, $create_new = true)
public function verify_autologin_id($userdata, bool $expire_check = false, bool $create_new = true): bool|string
{
global $bb_cfg;
@ -534,14 +525,14 @@ class User
/**
* Create autologin_id
*
* @param $userdata
* @param array $userdata
* @param bool $create_new
*
* @return bool|string
* @return string
*/
public function create_autologin_id($userdata, $create_new = true)
public function create_autologin_id(array $userdata, bool $create_new = true): string
{
$autologin_id = ($create_new) ? make_rand_str(LOGIN_KEY_LENGTH) : '';
$autologin_id = $create_new ? make_rand_str(LOGIN_KEY_LENGTH) : '';
DB()->query("
UPDATE " . BB_USERS . " SET