Skip to content
Snippets Groups Projects
Commit 6af53781 authored by Pavel Břoušek's avatar Pavel Břoušek Committed by Tim van Dijen
Browse files

allow session.check_function to be any Callable (#1263)

parent 6607b7fb
No related branches found
No related tags found
No related merge requests found
......@@ -174,9 +174,8 @@ class Session implements \Serializable, Utils\ClearableState
$this->markDirty();
// initialize data for session check function if defined
$checkFunction = self::$config->getArray('session.check_function', null);
if (isset($checkFunction)) {
assert(is_callable($checkFunction));
$checkFunction = self::$config->getValue('session.check_function', null);
if (is_callable($checkFunction)) {
call_user_func($checkFunction, $this, true);
}
}
......@@ -367,9 +366,8 @@ class Session implements \Serializable, Utils\ClearableState
}
// run session check function if defined
$checkFunction = $globalConfig->getArray('session.check_function', null);
if (isset($checkFunction)) {
assert(is_callable($checkFunction));
$checkFunction = $globalConfig->getValue('session.check_function', null);
if (is_callable($checkFunction)) {
$check = call_user_func($checkFunction, $session);
if ($check !== true) {
Logger::warning('Session did not pass check function.');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment