isCsrfTokenValid() replace string by ?string
This commit is contained in:
parent
99c5b77319
commit
37fbbca086
@ -370,12 +370,12 @@ trait ControllerTrait
|
||||
/**
|
||||
* Checks the validity of a CSRF token.
|
||||
*
|
||||
* @param string $id The id used when generating the token
|
||||
* @param string $token The actual token sent with the request that should be validated
|
||||
* @param string $id The id used when generating the token
|
||||
* @param string|null $token The actual token sent with the request that should be validated
|
||||
*
|
||||
* @final since version 3.4
|
||||
*/
|
||||
protected function isCsrfTokenValid(string $id, string $token): bool
|
||||
protected function isCsrfTokenValid(string $id, ?string $token): bool
|
||||
{
|
||||
if (!$this->container->has('security.csrf.token_manager')) {
|
||||
throw new \LogicException('CSRF protection is not enabled in your application. Enable it with the "csrf_protection" key in "config/packages/framework.yaml".');
|
||||
|
Reference in New Issue
Block a user