From 746c3fdf29d7833a20dde1a1ddbf10d0854f8a55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Fri, 30 Jun 2023 01:41:21 +0200 Subject: [PATCH] Remove BC layer for HttpFoundation < 6.1 --- .../Security/Http/Authenticator/FormLoginAuthenticator.php | 2 +- .../Security/Http/Authenticator/JsonLoginAuthenticator.php | 2 +- src/Symfony/Component/Security/Http/composer.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Security/Http/Authenticator/FormLoginAuthenticator.php b/src/Symfony/Component/Security/Http/Authenticator/FormLoginAuthenticator.php index c515417ad6ba1..116525ca8edf3 100644 --- a/src/Symfony/Component/Security/Http/Authenticator/FormLoginAuthenticator.php +++ b/src/Symfony/Component/Security/Http/Authenticator/FormLoginAuthenticator.php @@ -74,7 +74,7 @@ public function supports(Request $request): bool { return ($this->options['post_only'] ? $request->isMethod('POST') : true) && $this->httpUtils->checkRequestPath($request, $this->options['check_path']) - && ($this->options['form_only'] ? 'form' === (method_exists(Request::class, 'getContentTypeFormat') ? $request->getContentTypeFormat() : $request->getContentType()) : true); + && ($this->options['form_only'] ? 'form' === $request->getContentTypeFormat() : true); } public function authenticate(Request $request): Passport diff --git a/src/Symfony/Component/Security/Http/Authenticator/JsonLoginAuthenticator.php b/src/Symfony/Component/Security/Http/Authenticator/JsonLoginAuthenticator.php index 73b4dd434db69..3eaafc7aebb93 100644 --- a/src/Symfony/Component/Security/Http/Authenticator/JsonLoginAuthenticator.php +++ b/src/Symfony/Component/Security/Http/Authenticator/JsonLoginAuthenticator.php @@ -66,7 +66,7 @@ public function supports(Request $request): ?bool { if ( !str_contains($request->getRequestFormat() ?? '', 'json') - && !str_contains((method_exists(Request::class, 'getContentTypeFormat') ? $request->getContentTypeFormat() : $request->getContentType()) ?? '', 'json') + && !str_contains($request->getContentTypeFormat() ?? '', 'json') ) { return false; } diff --git a/src/Symfony/Component/Security/Http/composer.json b/src/Symfony/Component/Security/Http/composer.json index 8554682850c80..d8ab6ad3f7f56 100644 --- a/src/Symfony/Component/Security/Http/composer.json +++ b/src/Symfony/Component/Security/Http/composer.json @@ -19,7 +19,7 @@ "php": ">=8.1", "symfony/deprecation-contracts": "^2.5|^3", "symfony/security-core": "^6.3|^7.0", - "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^6.2|^7.0", "symfony/http-kernel": "^6.3|^7.0", "symfony/polyfill-mbstring": "~1.0", "symfony/property-access": "^5.4|^6.0|^7.0"