Browse Source

Update StatusController

Daniel Supernault 6 years ago
parent
commit
d0cd22f5b4
1 changed files with 7 additions and 1 deletions
  1. 7 1
      app/Http/Controllers/StatusController.php

+ 7 - 1
app/Http/Controllers/StatusController.php

@@ -85,7 +85,13 @@ class StatusController extends Controller
         }
         }
 
 
         $this->validate($request, [
         $this->validate($request, [
-          'photo.*'      => 'required|mimes:jpeg,png,gif|max:'.config('pixelfed.max_photo_size'),
+          'photo.*'      => function() {
+            return [
+                'required',
+                'mimes:' . config('pixelfed.media_types'),
+                'max:' . config('pixelfed.max_photo_size'),
+            ];
+          },
           'caption'      => 'string|max:'.config('pixelfed.max_caption_length'),
           'caption'      => 'string|max:'.config('pixelfed.max_caption_length'),
           'cw'           => 'nullable|string',
           'cw'           => 'nullable|string',
           'filter_class' => 'nullable|string',
           'filter_class' => 'nullable|string',