summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-06-06 23:35:20 +0100
committerLester Caine <lester@lsces.co.uk>2026-06-06 23:35:20 +0100
commit8a2962f8d9cc5a2160e82d06f2978002003e9694 (patch)
tree475eb61d7447d8c570af55cd41622872633c070a
parent88a8fbd1ffca15e0ee6a83fc0cbbf8c7f19464ce (diff)
downloadkernel-8a2962f8d9cc5a2160e82d06f2978002003e9694.tar.gz
kernel-8a2962f8d9cc5a2160e82d06f2978002003e9694.tar.bz2
kernel-8a2962f8d9cc5a2160e82d06f2978002003e9694.zip
kernel: load mConfig before checkEnvironment writes to it
checkEnvironment() called setConfig() to record site_server_type before mConfig had been loaded from the database. This left mConfig non-empty with only the server-type entry, so the subsequent empty() guard in loadConfig() short-circuited and site_title was never loaded. Result: getSiteCookieName() fell back to 'bit-user-bitweaver' on every request where checkEnvironment() ran first, creating a second spurious cookie alongside the real 'bit-user-<site>' cookie and splitting sessions. Fix: call loadConfig() at the top of checkEnvironment() if mConfig is not yet populated, matching the pattern used elsewhere. The bit-user-bitweaver fallback is now only reached during a genuine cold install. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
-rwxr-xr-xincludes/classes/BitSystem.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/includes/classes/BitSystem.php b/includes/classes/BitSystem.php
index 2a78ca7..f65d645 100755
--- a/includes/classes/BitSystem.php
+++ b/includes/classes/BitSystem.php
@@ -1699,11 +1699,13 @@ class BitSystem extends BitSingleton {
if( $checked ) {
return;
}
-
+ if( empty( $this->mConfig ) ) {
+ $this->loadConfig();
+ }
$errors = '';
$docroot = BIT_ROOT_PATH;
-
+
$serverSoftware = $_SERVER['SERVER_SOFTWARE'] ?? '';
if( stripos( $serverSoftware, 'nginx' ) !== false ) {