Fix unsecure redirect code.

This commit is contained in:
James Cole
2021-10-02 13:28:56 +02:00
parent 4e84a5c40c
commit 8662dfa4c0
3 changed files with 58 additions and 2 deletions

View File

@@ -183,7 +183,7 @@ trait UserNavigation
// get host of previous URL:
$previous = parse_url($return, PHP_URL_HOST);
if ($default === $previous && (null === $errors || (0 === $errors->count())) && !Str::contains($return, $forbidden)) {
if (null !== $previous && $default === $previous && (null === $errors || (0 === $errors->count())) && !Str::contains($return, $forbidden)) {
Log::debug(sprintf('Saving URL %s under key %s', $return, $identifier));
session()->put($identifier, $return);