mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-03-13 08:00:15 +00:00
Fix checking if the session is active
The phpversion check was backwards. For PHP >= 5.4.0 we should be using session_status() === PHP_SESSION_ACTIVE not < 5.4.0. But in fact, we only support >= 5.4.0, so this check is now redundant.
This commit is contained in:
parent
ecda4395e8
commit
3bf44378fa
@ -16,11 +16,7 @@ function updateCsrf() {
|
||||
* @return bool
|
||||
*/
|
||||
function sessionExists() {
|
||||
if (version_compare(phpversion(), '5.4.0', '>')) {
|
||||
return session_id() !== '';
|
||||
} else {
|
||||
return session_status() === PHP_SESSION_ACTIVE;
|
||||
}
|
||||
return session_status() === PHP_SESSION_ACTIVE;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -116,4 +112,4 @@ function verifyCsrf($csrf_token) {
|
||||
*/
|
||||
function verifyCsrfPost() {
|
||||
return (isset($_POST['csrf_token']) && verifyCsrf($_POST['csrf_token']));
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user