Minor fixes (#662)

This commit is contained in:
Roman Kelesidis 2023-03-28 10:25:03 +07:00 committed by GitHub
commit 6e666695e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 10 deletions

View file

@ -52,12 +52,6 @@ if (!file_exists(__DIR__ . '/vendor/autoload.php')) {
}
require_once __DIR__ . '/vendor/autoload.php';
/**
* Progressive error reporting
*/
define('DBG_USER', (isset($_COOKIE[COOKIE_DBG])));
\TorrentPier\Dev::debug_init();
/**
* Gets the value of an environment variable.
*
@ -80,6 +74,12 @@ if (file_exists(__DIR__ . '/library/config.local.php')) {
require_once __DIR__ . '/library/config.local.php';
}
/**
* Progressive error reporting
*/
define('DBG_USER', (isset($_COOKIE[COOKIE_DBG])));
\TorrentPier\Dev::debug_init();
$server_protocol = $bb_cfg['cookie_secure'] ? 'https://' : 'http://';
$server_port = in_array((int)$bb_cfg['server_port'], array(80, 443), true) ? '' : ':' . $bb_cfg['server_port'];
define('FORUM_PATH', $bb_cfg['script_path']);

View file

@ -44,12 +44,12 @@ class Sessions
/**
* Set userdata to cache
*
* @param array $userdata
* @param array|null $userdata
* @param bool $force
*
* @return bool
*/
public static function cache_set_userdata(array $userdata, bool $force = false): bool
public static function cache_set_userdata(?array $userdata, bool $force = false): bool
{
global $bb_cfg;
@ -97,11 +97,11 @@ class Sessions
/**
* Update userdata in cache
*
* @param array $userdata
* @param array|null $userdata
*
* @return bool
*/
public static function cache_update_userdata(array $userdata): bool
public static function cache_update_userdata(?array $userdata): bool
{
return self::cache_set_userdata($userdata, true);
}