summaryrefslogtreecommitdiffstats
path: root/Core
diff options
context:
space:
mode:
Diffstat (limited to 'Core')
-rw-r--r--Core/Authentication/Provider/UserAuthenticationProvider.php2
-rw-r--r--Core/Authentication/RememberMe/PersistentToken.php2
-rw-r--r--Core/User/User.php2
3 files changed, 3 insertions, 3 deletions
diff --git a/Core/Authentication/Provider/UserAuthenticationProvider.php b/Core/Authentication/Provider/UserAuthenticationProvider.php
index ded53e4..2674088 100644
--- a/Core/Authentication/Provider/UserAuthenticationProvider.php
+++ b/Core/Authentication/Provider/UserAuthenticationProvider.php
@@ -62,7 +62,7 @@ abstract class UserAuthenticationProvider implements AuthenticationProviderInter
}
$username = $token->getUsername();
- if (empty($username)) {
+ if ('' === $username || null === $username) {
$username = 'NONE_PROVIDED';
}
diff --git a/Core/Authentication/RememberMe/PersistentToken.php b/Core/Authentication/RememberMe/PersistentToken.php
index 92fcb4f..d85572d 100644
--- a/Core/Authentication/RememberMe/PersistentToken.php
+++ b/Core/Authentication/RememberMe/PersistentToken.php
@@ -40,7 +40,7 @@ final class PersistentToken implements PersistentTokenInterface
if (empty($class)) {
throw new \InvalidArgumentException('$class must not be empty.');
}
- if (empty($username)) {
+ if ('' === $username || null === $username) {
throw new \InvalidArgumentException('$username must not be empty.');
}
if (empty($series)) {
diff --git a/Core/User/User.php b/Core/User/User.php
index ea2c6a4..86f1acd 100644
--- a/Core/User/User.php
+++ b/Core/User/User.php
@@ -30,7 +30,7 @@ final class User implements AdvancedUserInterface
public function __construct($username, $password, array $roles = array(), $enabled = true, $userNonExpired = true, $credentialsNonExpired = true, $userNonLocked = true)
{
- if (empty($username)) {
+ if ('' === $username || null === $username) {
throw new \InvalidArgumentException('The username cannot be empty.');
}