Skip to content
This repository was archived by the owner on May 31, 2024. It is now read-only.

Commit 3d137c7

Browse files
Merge branch '2.3' into 2.7
* 2.3: [php7] Fix for substr() always returning a string [Security] Do not save the target path in the session for a stateless firewall [DependencyInjection] fixed FrozenParameterBag and improved Parameter… Conflicts: src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php
2 parents 30850d4 + 6c3c1e2 commit 3d137c7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Http/Firewall/ExceptionListener.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ class ExceptionListener
4747
private $errorPage;
4848
private $logger;
4949
private $httpUtils;
50+
private $stateless;
5051

51-
public function __construct(TokenStorageInterface $tokenStorage, AuthenticationTrustResolverInterface $trustResolver, HttpUtils $httpUtils, $providerKey, AuthenticationEntryPointInterface $authenticationEntryPoint = null, $errorPage = null, AccessDeniedHandlerInterface $accessDeniedHandler = null, LoggerInterface $logger = null)
52+
public function __construct(TokenStorageInterface $tokenStorage, AuthenticationTrustResolverInterface $trustResolver, HttpUtils $httpUtils, $providerKey, AuthenticationEntryPointInterface $authenticationEntryPoint = null, $errorPage = null, AccessDeniedHandlerInterface $accessDeniedHandler = null, LoggerInterface $logger = null, $stateless = false)
5253
{
5354
$this->tokenStorage = $tokenStorage;
5455
$this->accessDeniedHandler = $accessDeniedHandler;
@@ -58,6 +59,7 @@ public function __construct(TokenStorageInterface $tokenStorage, AuthenticationT
5859
$this->authenticationTrustResolver = $trustResolver;
5960
$this->errorPage = $errorPage;
6061
$this->logger = $logger;
62+
$this->stateless = $stateless;
6163
}
6264

6365
/**
@@ -185,7 +187,9 @@ private function startAuthentication(Request $request, AuthenticationException $
185187
$this->logger->debug('Calling Authentication entry point.');
186188
}
187189

188-
$this->setTargetPath($request);
190+
if (!$this->stateless) {
191+
$this->setTargetPath($request);
192+
}
189193

190194
if ($authException instanceof AccountStatusException) {
191195
// remove the security token to prevent infinite redirect loops

0 commit comments

Comments
 (0)