summaryrefslogtreecommitdiffstats
path: root/Core/Authentication
diff options
context:
space:
mode:
authorNicolas Grekas <nicolas.grekas@gmail.com>2015-07-22 12:11:00 +0200
committerNicolas Grekas <nicolas.grekas@gmail.com>2015-07-22 12:11:00 +0200
commit3570d0fe102983c1b7c631e148e1b477f31e1a7f (patch)
tree007902f46c0f3ed218fef1d4fffca237afe8ab6f /Core/Authentication
parent2d3106bc00eabe7706adb66ea4dc5fcca244a694 (diff)
parent7ab68c8fe7a6bedf4f6302c027e96d9da47b6bd0 (diff)
downloadsymfony-security-3570d0fe102983c1b7c631e148e1b477f31e1a7f.zip
symfony-security-3570d0fe102983c1b7c631e148e1b477f31e1a7f.tar.gz
symfony-security-3570d0fe102983c1b7c631e148e1b477f31e1a7f.tar.bz2
Merge branch '2.6' into 2.7
* 2.6: [Security] fix check for empty usernames [Form] updated exception message of ButtonBuilder::setRequestHandler() [travis] Fix deps=high jobs [HttpFoundation] [PSR-7] Allow to use resources as content body and to return resources from string content [DependencyInjection] Remove unused code in XmlFileLoader [HttpFoundation] Behaviour change in PHP7 for substr bumped Symfony version to 2.3.32 updated VERSION for 2.3.31 update CONTRIBUTORS for 2.3.31 updated CHANGELOG for 2.3.31 Conflicts: src/Symfony/Bridge/Twig/composer.json src/Symfony/Bundle/FrameworkBundle/composer.json
Diffstat (limited to 'Core/Authentication')
-rw-r--r--Core/Authentication/Provider/UserAuthenticationProvider.php2
-rw-r--r--Core/Authentication/RememberMe/PersistentToken.php2
2 files changed, 2 insertions, 2 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)) {