Skip to content

Commit 7800a74

Browse files
committed
set csrf_tokens array even if unauthenticated
1 parent 9e9954c commit 7800a74

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

resources/init.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
$_SESSION["messages"] = [];
3939
}
4040

41+
if (!array_key_exists("csrf_tokens", $_SESSION)) {
42+
$_SESSION["csrf_tokens"] = [];
43+
}
44+
4145
if (isset($_SERVER["REMOTE_USER"])) {
4246
// Check if SSO is enabled on this page
4347
$SSO = UnitySSO::getSSO();
@@ -57,10 +61,6 @@
5761
$SEND_PIMESG_TO_ADMINS = CONFIG["mail"]["send_pimesg_to_admins"];
5862

5963
$SQL->addLog($OPERATOR->uid, $_SERVER["REMOTE_ADDR"], "user_login", $OPERATOR->uid);
60-
61-
if (!array_key_exists("csrf_tokens", $_SESSION)) {
62-
$_SESSION["csrf_tokens"] = [];
63-
}
6464
}
6565

6666
$LOC_HEADER = __DIR__ . "/templates/header.php";

0 commit comments

Comments
 (0)