summaryrefslogtreecommitdiffstats
path: root/Core/Authentication/Token/AbstractToken.php
diff options
context:
space:
mode:
authorJohannes M. Schmitt <schmittjoh@gmail.com>2011-03-09 09:56:08 +0100
committerJohannes M. Schmitt <schmittjoh@gmail.com>2011-03-10 10:25:33 +0100
commitb447605b8450af3942f421513fd5ca45490615c1 (patch)
tree8f93be26d05afe9251662e5689a7634255844679 /Core/Authentication/Token/AbstractToken.php
parent4ad18ddf07435fe6fcb5ac47ef099419b0ad5a5b (diff)
downloadsymfony-security-b447605b8450af3942f421513fd5ca45490615c1.zip
symfony-security-b447605b8450af3942f421513fd5ca45490615c1.tar.gz
symfony-security-b447605b8450af3942f421513fd5ca45490615c1.tar.bz2
[Security] added some more tests
Diffstat (limited to 'Core/Authentication/Token/AbstractToken.php')
-rw-r--r--Core/Authentication/Token/AbstractToken.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/Core/Authentication/Token/AbstractToken.php b/Core/Authentication/Token/AbstractToken.php
index 3839154..210e46d 100644
--- a/Core/Authentication/Token/AbstractToken.php
+++ b/Core/Authentication/Token/AbstractToken.php
@@ -84,11 +84,15 @@ abstract class AbstractToken implements TokenInterface
if (null === $this->user) {
$changed = false;
} else if ($this->user instanceof UserInterface) {
- $changed = $this->user->equals($user);
+ if (!$user instanceof UserInterface) {
+ $changed = true;
+ } else {
+ $changed = !$this->user->equals($user);
+ }
} else if ($user instanceof UserInterface) {
$changed = true;
} else {
- $changed = (string) $this->user === (string) $user;
+ $changed = (string) $this->user !== (string) $user;
}
if ($changed) {