Commit eeb22be0 authored by Quentin Ribac's avatar Quentin Ribac
Browse files

FIX #17437 TIME 0:10 added missing error handling

parent 2b8b7681
...@@ -123,7 +123,11 @@ class CoreController ...@@ -123,7 +123,11 @@ class CoreController
if (in_array($queryParams['image'], ['logo', 'onlyLogo'])) { if (in_array($queryParams['image'], ['logo', 'onlyLogo'])) {
$mimeType = 'image/svg+xml'; $mimeType = 'image/svg+xml';
} else { } else {
$mimeType = CoreController::getMimeTypeAndFileSize(['path' => $path]); $mimeAndSize = CoreController::getMimeTypeAndFileSize(['path' => $path]);
if (!empty($mimeAndSize['errors'])) {
return $response->withStatus(400)->withJson(['errors' => $mimeAndSize['errors']]);
}
$mimeType = $mimeAndSize['mime'];
} }
$pathInfo = pathinfo($path); $pathInfo = pathinfo($path);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment