Skip to content

Commit

Permalink
[Security] Fix wrong cache directive when using the new PUBLIC_ACCESS…
Browse files Browse the repository at this point in the history
… attribute
  • Loading branch information
wouterj committed Aug 17, 2021
1 parent 8393c0d commit 106639b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Hasher/UserPasswordHasher.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function hashPassword($user, string $plainPassword): string
} elseif ($user instanceof UserInterface) {
$salt = $user->getSalt();

if (null !== $salt) {
if ($salt) {
trigger_deprecation('symfony/password-hasher', '5.3', 'Returning a string from "getSalt()" without implementing the "%s" interface is deprecated, the "%s" class should implement it.', LegacyPasswordAuthenticatedUserInterface::class, get_debug_type($user));
}
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Hasher/UserPasswordHasherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public function testNeedsRehash()

$passwordHasher = new UserPasswordHasher($mockPasswordHasherFactory);

\Closure::bind(function () use ($passwordHasher) { $this->password = $passwordHasher->hashPassword($this, 'foo', 'salt'); }, $user, User::class)();
\Closure::bind(function () use ($passwordHasher) { $this->password = $passwordHasher->hashPassword($this, 'foo', 'salt'); }, $user, class_exists(User::class) ? User::class : InMemoryUser::class)();
$this->assertFalse($passwordHasher->needsRehash($user));
$this->assertTrue($passwordHasher->needsRehash($user));
$this->assertFalse($passwordHasher->needsRehash($user));
Expand Down

0 comments on commit 106639b

Please sign in to comment.