diff options
Diffstat (limited to 'apps/theming/lib/Controller')
-rw-r--r-- | apps/theming/lib/Controller/ThemingController.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/theming/lib/Controller/ThemingController.php b/apps/theming/lib/Controller/ThemingController.php index 421af051998..5e1e3d08dc9 100644 --- a/apps/theming/lib/Controller/ThemingController.php +++ b/apps/theming/lib/Controller/ThemingController.php @@ -248,8 +248,9 @@ class ThemingController extends Controller { } $target = $folder->newFile($key); - $supportedFormats = ['image/jpeg', 'image/png', 'image/gif', 'image/svg+xml', 'text/svg']; - if (!in_array($image['type'], $supportedFormats)) { + $supportedFormats = ['image/jpeg', 'image/png', 'image/gif', 'image/svg+xml', 'image/svg']; + $detectedMimeType = mime_content_type($image['tmp_name']); + if (!in_array($image['type'], $supportedFormats) || !in_array($detectedMimeType, $supportedFormats)) { return new DataResponse( [ 'data' => [ |