From 4156921bcaa9228d23e3179210c23acffe910715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Vernet?= Date: Fri, 20 Dec 2024 22:36:39 +0100 Subject: [PATCH] fix: avoid error with Symfony 6.4 LTS downgrade (#139) --- config/packages/csrf.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/packages/csrf.php b/config/packages/csrf.php index c033a11..45d930d 100644 --- a/config/packages/csrf.php +++ b/config/packages/csrf.php @@ -3,8 +3,14 @@ declare(strict_types=1); use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symfony\Component\HttpKernel\Kernel; return static function (ContainerConfigurator $containerConfigurator): void { + // This configutation file is specific to Symfony 7.2+ + if (Kernel::VERSION_ID < 70200) { + return; + } + // Enable stateless CSRF protection for forms and logins/logouts $containerConfigurator->extension('framework', [ 'form' => [