Skip to content

Commit 743692c

Browse files
committed
AuthenticationUtils::getLastUsername()` now always returns a string.
1 parent e0f79f6 commit 743692c

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

UPGRADE-4.1.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ Security
6565
* Using the `AdvancedUserInterface` is now deprecated. To use the existing
6666
functionality, create a custom user-checker based on the
6767
`Symfony\Component\Security\Core\User\UserChecker`.
68+
* `AuthenticationUtils::getLastUsername()` now always returns a string.
6869

6970
SecurityBundle
7071
--------------

src/Symfony/Component/Security/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ CHANGELOG
99
* Using the AdvancedUserInterface is now deprecated. To use the existing
1010
functionality, create a custom user-checker based on the
1111
`Symfony\Component\Security\Core\User\UserChecker`.
12+
* `AuthenticationUtils::getLastUsername()` now always returns a string.
1213

1314
4.0.0
1415
-----

src/Symfony/Component/Security/Http/Authentication/AuthenticationUtils.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ public function getLastUsername()
6262
$request = $this->getRequest();
6363

6464
if ($request->attributes->has(Security::LAST_USERNAME)) {
65-
return $request->attributes->get(Security::LAST_USERNAME);
65+
return $request->attributes->get(Security::LAST_USERNAME, '');
6666
}
6767

6868
$session = $request->getSession();
6969

70-
return null === $session ? '' : $session->get(Security::LAST_USERNAME);
70+
return null === $session ? '' : $session->get(Security::LAST_USERNAME, '');
7171
}
7272

7373
/**

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy