From 6e666695e8199a4e6a18c05306992b3fbc6f6017 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Tue, 28 Mar 2023 10:25:03 +0700 Subject: [PATCH] Minor fixes (#662) --- common.php | 12 ++++++------ src/Sessions.php | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/common.php b/common.php index db5a0f77f..d9583595d 100644 --- a/common.php +++ b/common.php @@ -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']); diff --git a/src/Sessions.php b/src/Sessions.php index aa2196f2d..e28d41854 100644 --- a/src/Sessions.php +++ b/src/Sessions.php @@ -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); }