From e26ac5110934ad0a0d6233a505f8f70b7daca18b Mon Sep 17 00:00:00 2001 From: sarbanha Date: Tue, 11 Oct 2022 12:27:39 +0400 Subject: [PATCH] getLastUsername() return value coalesced properly --- .../Security/Http/Authentication/AuthenticationUtils.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Security/Http/Authentication/AuthenticationUtils.php b/src/Symfony/Component/Security/Http/Authentication/AuthenticationUtils.php index 69b07d0efed83..6119e4ff1c21d 100644 --- a/src/Symfony/Component/Security/Http/Authentication/AuthenticationUtils.php +++ b/src/Symfony/Component/Security/Http/Authentication/AuthenticationUtils.php @@ -53,10 +53,10 @@ public function getLastUsername(): string $request = $this->getRequest(); if ($request->attributes->has(Security::LAST_USERNAME)) { - return $request->attributes->get(Security::LAST_USERNAME, ''); + return $request->attributes->get(Security::LAST_USERNAME, '') ?? ''; } - return $request->hasSession() ? $request->getSession()->get(Security::LAST_USERNAME, '') : ''; + return ($request->hasSession() ? $request->getSession()->get(Security::LAST_USERNAME, '') : '') ?? ''; } /**