AuthenticationUtils::getLastUsername()` now always returns a string.
This commit is contained in:
parent
e0f79f69be
commit
743692c3fd
|
@ -65,6 +65,7 @@ Security
|
|||
* Using the `AdvancedUserInterface` is now deprecated. To use the existing
|
||||
functionality, create a custom user-checker based on the
|
||||
`Symfony\Component\Security\Core\User\UserChecker`.
|
||||
* `AuthenticationUtils::getLastUsername()` now always returns a string.
|
||||
|
||||
SecurityBundle
|
||||
--------------
|
||||
|
|
|
@ -9,6 +9,7 @@ CHANGELOG
|
|||
* Using the AdvancedUserInterface is now deprecated. To use the existing
|
||||
functionality, create a custom user-checker based on the
|
||||
`Symfony\Component\Security\Core\User\UserChecker`.
|
||||
* `AuthenticationUtils::getLastUsername()` now always returns a string.
|
||||
|
||||
4.0.0
|
||||
-----
|
||||
|
|
|
@ -62,12 +62,12 @@ class AuthenticationUtils
|
|||
$request = $this->getRequest();
|
||||
|
||||
if ($request->attributes->has(Security::LAST_USERNAME)) {
|
||||
return $request->attributes->get(Security::LAST_USERNAME);
|
||||
return $request->attributes->get(Security::LAST_USERNAME, '');
|
||||
}
|
||||
|
||||
$session = $request->getSession();
|
||||
|
||||
return null === $session ? '' : $session->get(Security::LAST_USERNAME);
|
||||
return null === $session ? '' : $session->get(Security::LAST_USERNAME, '');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Reference in New Issue