Skip to content

Commit

Permalink
Merge branch 'release/1.7.39.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Feb 20, 2023
2 parents 8c365d4 + 8efb000 commit 8a7e387
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion system/defines.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
11 changes: 8 additions & 3 deletions system/src/Grav/Framework/Session/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use ArrayIterator;
use Exception;
use Throwable;
use Grav\Common\Debugger;
use Grav\Common\Grav;
use Grav\Common\User\Interfaces\UserInterface;
Expand Down Expand Up @@ -254,13 +255,17 @@ public function start($readonly = false)
$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();
Expand Down

0 comments on commit 8a7e387

Please sign in to comment.