Skip to content

Commit 79d20ad

Browse files
Merge branch '3.4' into 4.3
* 3.4: [Debug] fix ClassNotFoundFatalErrorHandler [Dotenv] Fixed infinite loop with missing quote followed by quoted value [TwigBridge] button_widget now has its title attr translated even if its label = null or false [PhpUnitBridge] When using phpenv + phpenv-composer plugin, composer executable is wrapped into a bash script [Security] Prevent canceled remember-me cookie from being accepted [FrameworkBundle][TranslationUpdateCommand] Do not output positive feedback on stderr
2 parents d0ffa06 + f8ea473 commit 79d20ad

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

RememberMe/AbstractRememberMeServices.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ public function getSecret()
9393
*/
9494
final public function autoLogin(Request $request): ?TokenInterface
9595
{
96+
if (($cookie = $request->attributes->get(self::COOKIE_ATTR_NAME)) && null === $cookie->getValue()) {
97+
return null;
98+
}
99+
96100
if (null === $cookie = $request->cookies->get($this->options['name'])) {
97101
return null;
98102
}

Tests/RememberMe/AbstractRememberMeServicesTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ public function testAutoLoginReturnsNullWhenNoCookie()
3939
$this->assertNull($service->autoLogin(new Request()));
4040
}
4141

42+
public function testAutoLoginReturnsNullAfterLoginFail()
43+
{
44+
$service = $this->getService(null, ['name' => 'foo', 'path' => null, 'domain' => null]);
45+
46+
$request = new Request();
47+
$request->cookies->set('foo', 'foo');
48+
49+
$service->loginFail($request);
50+
$this->assertNull($service->autoLogin($request));
51+
}
52+
4253
/**
4354
* @group legacy
4455
*/

0 commit comments

Comments
 (0)