Skip to content

Commit

Permalink
Merge pull request #3460 from bolt/fix/uppercase-extensions-thumbs
Browse files Browse the repository at this point in the history
Allow thumbnails for files with uppercase EXTENSIONS.
  • Loading branch information
bobdenotter committed Jun 6, 2023
2 parents fd6f250 + 1048539 commit 49ac53a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Controller/ImageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,9 @@ private function isImage(string $filename): bool
$pathinfo = pathinfo($filename);

$imageExtensions = ['gif', 'png', 'jpg', 'jpeg', 'svg', 'avif', 'webp'];
$ext = mb_strtolower($pathinfo['extension']);

return array_key_exists('extension', $pathinfo) && in_array($pathinfo['extension'], $imageExtensions, true);
return array_key_exists('extension', $pathinfo) && in_array($ext, $imageExtensions, true);
}

private function testFit(string $fit): bool
Expand Down

0 comments on commit 49ac53a

Please sign in to comment.