Skip to content

Commit 052d812

Browse files
Merge branch '4.4' into 5.0
* 4.4: [PropertyAccess] fix tests [WebProfilerBundle] fix test remove assertions that can never be reached [PropertyAccess] Improve message of unitialized property in php 7.4 [HttpFoundation] Fixed session migration with custom cookie lifetime [HttpKernel][FrameworkBundle] fix compat with Debug component [Serializer] Remove unused variable Allow URL-encoded special characters in basic auth part of URLs [Serializer] Fix unitialized properties (from PHP 7.4.2) when serializing context for the cache key [Validator] Add missing Ukrainian and Russian translations Track session usage when setting the token [4.4][MonologBridge] Fix $level type No need to reconnect the bags to the session Support for Content Security Policy style-src-elem and script-src-elem in WebProfiler [PropertyInfo][ReflectionExtractor] Check the array mutator prefixes last when the property is singular [Security][Http][SwitchUserListener] Ignore all non existent username protection errors Add installation and minimal example to README
2 parents af7315d + 055a4f4 commit 052d812

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

Firewall/SwitchUserListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ private function attemptSwitchUser(Request $request, string $username): ?TokenIn
158158

159159
try {
160160
$this->provider->loadUserByUsername($nonExistentUsername);
161-
} catch (AuthenticationException $e) {
161+
} catch (\Exception $e) {
162162
}
163163
} catch (AuthenticationException $e) {
164164
$this->provider->loadUserByUsername($currentUsername);

Tests/Firewall/ContextListenerTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,9 @@ protected function runSessionOnKernelResponse($newToken, $original = null)
406406

407407
private function handleEventWithPreviousSession($userProviders, UserInterface $user = null, RememberMeServicesInterface $rememberMeServices = null)
408408
{
409-
$user = $user ?: new User('foo', 'bar');
409+
$tokenUser = $user ?: new User('foo', 'bar');
410410
$session = new Session(new MockArraySessionStorage());
411-
$session->set('_security_context_key', serialize(new UsernamePasswordToken($user, '', 'context_key', ['ROLE_USER'])));
411+
$session->set('_security_context_key', serialize(new UsernamePasswordToken($tokenUser, '', 'context_key', ['ROLE_USER'])));
412412

413413
$request = new Request();
414414
$request->setSession($session);
@@ -431,6 +431,10 @@ private function handleEventWithPreviousSession($userProviders, UserInterface $u
431431
}
432432
$listener(new RequestEvent($this->getMockBuilder(HttpKernelInterface::class)->getMock(), $request, HttpKernelInterface::MASTER_REQUEST));
433433

434+
if (null !== $user) {
435+
++$usageIndex;
436+
}
437+
434438
$this->assertSame($usageIndex, $session->getUsageIndex());
435439
$tokenStorage->getToken();
436440
$this->assertSame(1 + $usageIndex, $session->getUsageIndex());

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
],
1818
"require": {
1919
"php": "^7.2.5",
20-
"symfony/security-core": "^4.4.7|^5.0.7",
20+
"symfony/security-core": "^4.4.8|^5.0.8",
2121
"symfony/http-foundation": "^4.4.7|^5.0.7",
2222
"symfony/http-kernel": "^4.4|^5.0",
2323
"symfony/property-access": "^4.4|^5.0"

0 commit comments

Comments
 (0)