mirror of
https://github.com/getgrav/grav.git
synced 2026-07-19 21:41:14 +02:00
Merge branch 'release/1.7.39.2'
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
# v1.7.39.2
|
||||
## 02/20/2023
|
||||
|
||||
1. [](#bugfix)
|
||||
* Fix for invalid session breaking Flex Accounts (when switching from Regular to Flex)
|
||||
|
||||
# v1.7.39.1
|
||||
## 02/20/2023
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
// Some standard defines
|
||||
define('GRAV', true);
|
||||
define('GRAV_VERSION', '1.7.39.1');
|
||||
define('GRAV_VERSION', '1.7.39.2');
|
||||
define('GRAV_SCHEMA', '1.7.0_2020-11-20_1');
|
||||
define('GRAV_TESTING', false);
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace Grav\Framework\Session;
|
||||
|
||||
use ArrayIterator;
|
||||
use Exception;
|
||||
use Throwable;
|
||||
use Grav\Common\Debugger;
|
||||
use Grav\Common\Grav;
|
||||
use Grav\Common\User\Interfaces\UserInterface;
|
||||
@@ -254,13 +255,17 @@ class Session implements SessionInterface
|
||||
$this->started = true;
|
||||
$this->onSessionStart();
|
||||
|
||||
$user = $this->__get('user');
|
||||
if ($user && (!$user instanceof UserInterface || (method_exists($user, 'isValid') && !$user->isValid()))) {
|
||||
try {
|
||||
$user = $this->__get('user');
|
||||
if ($user && (!$user instanceof UserInterface || (method_exists($user, 'isValid') && !$user->isValid()))) {
|
||||
throw new RuntimeException('Bad user');
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
$this->invalidate();
|
||||
|
||||
throw new SessionException('Invalid User object, session destroyed.', 500);
|
||||
}
|
||||
|
||||
|
||||
// Extend the lifetime of the session.
|
||||
if ($sessionExists) {
|
||||
$this->setCookie();
|
||||
|
||||
Reference in New Issue
Block a user