8000 bug #42380 [HttpFoundation] Don't pass null to strpos() (derrabus) · symfony/symfony@36ebebb · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit 36ebebb

Browse files
committed
bug #42380 [HttpFoundation] Don't pass null to strpos() (derrabus)
This PR was merged into the 5.3 branch. Discussion ---------- [HttpFoundation] Don't pass null to strpos() | Q | A | ------------- | --- | Branch? | 5.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | #41552 | License | MIT | Doc PR | N/A Passing `null` to `strpos()` triggers a deprecation warning in PHP 8.1. Let's not do that. Commits ------- bf9dca3 Don't pass null to strpos()
2 parents 094233f + bf9dca3 commit 36ebebb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/HttpFoundation/Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1333,7 +1333,7 @@ public static function getMimeTypes(string $format)
13331333
public function getFormat(?string $mimeType)
13341334
{
13351335
$canonicalMimeType = null;
1336-
if (false !== $pos = strpos($mimeType, ';')) {
1336+
if ($mimeType && false !== $pos = strpos($mimeType, ';')) {
13371337
$canonicalMimeType = trim(substr($mimeType, 0, $pos));
13381338
}
13391339

0 commit comments

Comments
 (0)
0