Skip to content

Commit

Permalink
Fixed a bug due to a variable overwriting
Browse files Browse the repository at this point in the history
  • Loading branch information
stof committed Jul 10, 2012
1 parent 7ebfe3d commit c3ffc16
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Changelog.md
@@ -1,6 +1,10 @@
Changelog
=========

### 1.2.2 (2012-07-10)

* Fixed a bug in the previous fix

### 1.2.1 (2012-07-10)

This release fixes a security issue. You are encouraged to update to it as soon
Expand Down
6 changes: 3 additions & 3 deletions Model/UserManager.php
Expand Up @@ -127,12 +127,12 @@ public function refreshUser(SecurityUserInterface $user)
throw new UnsupportedUserException(sprintf('Expected an instance of FOS\UserBundle\Model\User, but got "%s".', get_class($user)));
}

$user = $this->findUserBy(array('id' => $user->getId()));
if (null === $user) {
$refreshedUser = $this->findUserBy(array('id' => $user->getId()));
if (null === $refreshedUser) {
throw new UsernameNotFoundException(sprintf('User with ID "%d" could not be reloaded.', $user->getId()));
}

return $user;
return $refreshedUser;
}

/**
Expand Down

0 comments on commit c3ffc16

Please sign in to comment.