Skip to content

Commit b9e6c1f

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 ------- bf9dca3f17 Don't pass null to strpos()
2 parents fe4f8d9 + e2c4899 commit b9e6c1f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)