Skip to content

Commit 2bb540b

Browse files
authored
Merge pull request #2337 from W0rma/php81
Fix compatibility with PHP 8.1
2 parents 9e8e14f + 89c2f4d commit 2bb540b

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ jobs:
3535
symfony-require: "5.2.*"
3636
- php-version: 8.0
3737
composer-flags: "--ignore-platform-reqs --prefer-stable"
38+
- php-version: 8.1
39+
composer-flags: "--prefer-stable"
3840

3941
steps:
4042
- name: "Checkout"

EventListener/BodyListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ private function isDecodeable(Request $request): bool
125125

126126
private function isFormRequest(Request $request): bool
127127
{
128-
$contentTypeParts = explode(';', $request->headers->get('Content-Type'));
128+
$contentTypeParts = explode(';', $request->headers->get('Content-Type', ''));
129129

130130
if (isset($contentTypeParts[0])) {
131131
return in_array($contentTypeParts[0], ['multipart/form-data', 'application/x-www-form-urlencoded']);

View/JsonpHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ private function getCallback(Request $request): string
5050
$callback = $request->query->get($this->callbackParam);
5151
$validator = new \JsonpCallbackValidator();
5252

53-
if (!$validator->validate($callback)) {
53+
if (!is_string($callback) || !$validator->validate($callback)) {
5454
throw new BadRequestHttpException('Invalid JSONP callback value');
5555
}
5656

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"doctrine/annotations": "^1.13.2",
4545
"psr/log": "^1.0|^2.0|^3.0",
4646
"sensio/framework-extra-bundle": "^5.2.3",
47-
"symfony/phpunit-bridge": "^5.2",
47+
"symfony/phpunit-bridge": "^5.3.10",
4848
"symfony/asset": "^4.4|^5.0",
4949
"symfony/form": "^4.4|^5.0",
5050
"symfony/mime": "^4.4|^5.0",

0 commit comments

Comments
 (0)