Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f949c8c

Browse filesBrowse files
committed
Fix deprecations from getContentType
1 parent c2c3b20 commit f949c8c
Copy full SHA for f949c8c

File tree

2 files changed

+5
-2
lines changed
Filter options

2 files changed

+5
-2
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Http/Authenticator/FormLoginAuthenticator.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function supports(Request $request): bool
7575
{
7676
return ($this->options['post_only'] ? $request->isMethod('POST') : true)
7777
&& $this->httpUtils->checkRequestPath($request, $this->options['check_path'])
78-
&& ($this->options['form_only'] ? 'form' === $request->getContentType() : true);
78+
&& ($this->options['form_only'] ? 'form' === (method_exists(Request::class, 'getContentTypeFormat') ? $request->getContentTypeFormat) : $request->getContentType()) : true);
7979
}
8080

8181
public function authenticate(Request $request): Passport

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Http/Authenticator/JsonLoginAuthenticator.php
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ public function __construct(HttpUtils $httpUtils, UserProviderInterface $userPro
6565

6666
public function supports(Request $request): ?bool
6767
{
68-
if (!str_contains($request->getRequestFormat() ?? '', 'json') && !str_contains($request->getContentType() ?? '', 'json')) {
68+
if (
69+
!str_contains($request->getRequestFormat() ?? '', 'json')
70+
&& !str_contains((method_exists(Request::class, 'getContentTypeFormat') ? $request->getContentTypeFormat() : $request->getContentType()) ?? '', 'json')
71+
) {
6972
return false;
7073
}
7174

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.