]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Controllers/Controller.php
Added an env configurable file upload size limit
[bookstack] / app / Http / Controllers / Controller.php
index 047e0bed944ba0509ab88c841686acfd2d990809..f836f18edad2db02453717f3f2c4f4b43a099a77 100644 (file)
@@ -165,7 +165,7 @@ abstract class Controller extends BaseController
     /**
      * Log an activity in the system.
      *
-     * @param $detail string|Loggable
+     * @param string|Loggable $detail
      */
     protected function logActivity(string $type, $detail = ''): void
     {
@@ -177,6 +177,6 @@ abstract class Controller extends BaseController
      */
     protected function getImageValidationRules(): array
     {
-        return ['image_extension', 'mimes:jpeg,png,gif,webp'];
+        return ['image_extension', 'mimes:jpeg,png,gif,webp', 'max:' . (config('app.upload_limit') * 1000)];
     }
 }