]> BookStack Code Mirror - bookstack/commitdiff
Removed bmp and tiff support from uploaded images.
authorDan Brown <redacted>
Sun, 5 Apr 2020 15:15:05 +0000 (16:15 +0100)
committerDan Brown <redacted>
Sun, 5 Apr 2020 15:15:05 +0000 (16:15 +0100)
Fixes #1990

app/Http/Controllers/Controller.php
app/Providers/AppServiceProvider.php

index b9576f2febd7923293b8eacb105bab6130f118c1..2e8e8ed2ee12b005d58f9aab0492ef99dae0a56f 100644 (file)
@@ -195,6 +195,6 @@ abstract class Controller extends BaseController
      */
     protected function getImageValidationRules(): string
     {
-        return 'image_extension|no_double_extension|mimes:jpeg,png,gif,bmp,webp,tiff';
+        return 'image_extension|no_double_extension|mimes:jpeg,png,gif,webp';
     }
 }
index 3a1b4f42ee63e02118a72d798d8e837f12499018..1cc3e09c22dc6677a517af03ddbbd0efeb3eac3b 100644 (file)
@@ -34,7 +34,7 @@ class AppServiceProvider extends ServiceProvider
 
         // Custom validation methods
         Validator::extend('image_extension', function ($attribute, $value, $parameters, $validator) {
-            $validImageExtensions = ['png', 'jpg', 'jpeg', 'bmp', 'gif', 'tiff', 'webp'];
+            $validImageExtensions = ['png', 'jpg', 'jpeg', 'gif', 'webp'];
             return in_array(strtolower($value->getClientOriginalExtension()), $validImageExtensions);
         });