Get around a bug where messages were not always being set on session during redirect

This commit is contained in:
Andy Miller
2023-01-01 13:10:58 -07:00
parent 720a965c7e
commit 3f13d81c6f
2 changed files with 9 additions and 2 deletions

View File

@@ -4,9 +4,10 @@
1. [](#improved)
* Updated `bin/composer.phar` to latest `2.4.4` version [#3627](https://github.com/getgrav/grav/issues/3627)
1. [](#bugfix)
* Don't failhard if pages recurse with same path
* Get around a bug where messages were not always being set on session during redirect
* Don't fail hard if pages recurse with same path
* Github workflows security hardening [#3624](https://github.com/getgrav/grav/pull/3624)
# v1.7.37.1
## 10/05/2022

View File

@@ -439,6 +439,12 @@ class Grav extends Container
{
$response = $this->getRedirectResponse($route, $code);
$session = $this['session'] ?? null;
$messages = $this['messages'] ?? null;
if (!isset($session->messages) && $session && $messages) {
$session->messages = $messages;
}
$this->close($response);
}