]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Controllers/ImageController.php
Actually fixed the BaseURL this time 🤦
[bookstack] / app / Http / Controllers / ImageController.php
index c44b6e480429ab5f24292c0bc8bbab6c631fb789..e675bff0c5b52bbaef6e13db509f287ddfb31a63 100644 (file)
@@ -120,7 +120,10 @@ class ImageController extends Controller
         $this->validate($request, [
             'file' => 'is_image'
         ]);
-        // TODO - Restrict & validate types
+
+        if (!$this->imageRepo->isValidType($type)) {
+            return $this->jsonError(trans('errors.image_upload_type_error'));
+        }
 
         $imageUpload = $request->file('file');