10000 minor #50827 [Security] Remove BC layer for HttpFoundation < 6.2 (Gro… · symfony/symfony@80b5ef8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 80b5ef8

Browse files
minor #50827 [Security] Remove BC layer for HttpFoundation < 6.2 (GromNaN)
This PR was merged into the 6.4 branch. Discussion ---------- [Security] Remove BC layer for HttpFoundation < 6.2 | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | n/a In #45034, a condition was added to support `symfony/http-foundation < 6.2` or use the new `Request::getContentTypeFormat()` method when it exists. I propose to update the minimum version of `symfony/http-foundation` required by `symfony/security-http: 6.4`. `symfony/security-http: 6.4` already requires `symfony/http-kernel: ^6.3|^7.0` [which require](https://github.com/symfony/symfony/blob/6.3/src/Symfony/Component/HttpKernel/composer.json) `symfony/http-foundation: ^6.2.7` The legacy method `Request::getContentType()` will be removed in 7.0 by #50826 Commits ------- 746c3fd Remove BC layer for HttpFoundation < 6.1
2 parents 3e8566c + 746c3fd commit 80b5ef8

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/Symfony/Component/Security/Http/Authenticator/FormLoginAuthenticator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function supports(Request $request): bool
7474
{
7575
return ($this->options['post_only'] ? $request->isMethod('POST') : true)
7676
&& $this->httpUtils->checkRequestPath($request, $this->options['check_path'])
77-
&& ($this->options['form_only'] ? 'form' === (method_exists(Request::class, 'getContentTypeFormat') ? $request->getContentTypeFormat() : $request->getContentType()) : true);
77+
&& ($this->options['form_only'] ? 'form' === $request->getContentTypeFormat() : true);
7878
}
7979

8080
public function authenticate(Request $request): Passport

src/Symfony/Component/Security/Http/Authenticator/JsonLoginAuthenticator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function supports(Request $request): ?bool
6666
{
6767
if (
6868
!str_contains($request->getRequestFormat() ?? '', 'json')
69-
&& !str_contains((method_exists(Request::class, 'getContentTypeFormat') ? $request->getContentTypeFormat() : $request->getContentType()) ?? '', 'json')
69+
&& !str_contains($request->getContentTypeFormat() ?? '', 'json')
7070
) {
7171
return false;
7272
}

src/Symfony/Component/Security/Http/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"php": ">=8.1",
2020
"symfony/deprecation-contracts": "^2.5|^3",
2121
"symfony/security-core": "^6.3|^7.0",
22-
"symfony/http-foundation": "^5.4|^6.0|^7.0",
22+
"symfony/http-foundation": "^6.2|^7.0",
2323
"symfony/http-kernel": "^6.3|^7.0",
2424
"symfony/polyfill-mbstring": "~1.0",
2525
"symfony/property-access": "^5.4|^6.0|^7.0"

0 commit comments

Comments
 (0)
0