X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/c7fea8fe08e8d26840da7a0d353c05f7a84d3ff1..refs/pull/3821/head:/app/Http/Controllers/Images/ImageController.php diff --git a/app/Http/Controllers/Images/ImageController.php b/app/Http/Controllers/Images/ImageController.php index 231712d52..cd6b2d406 100644 --- a/app/Http/Controllers/Images/ImageController.php +++ b/app/Http/Controllers/Images/ImageController.php @@ -14,12 +14,9 @@ use Illuminate\Validation\ValidationException; class ImageController extends Controller { - protected $imageRepo; - protected $imageService; + protected ImageRepo $imageRepo; + protected ImageService $imageService; - /** - * ImageController constructor. - */ public function __construct(ImageRepo $imageRepo, ImageService $imageService) { $this->imageRepo = $imageRepo; @@ -33,7 +30,7 @@ class ImageController extends Controller */ public function showImage(string $path) { - if (!$this->imageService->pathExistsInLocalSecure($path)) { + if (!$this->imageService->pathAccessibleInLocalSecure($path)) { throw (new NotFoundException(trans('errors.image_not_found'))) ->setSubtitle(trans('errors.image_not_found_subtitle')) ->setDetails(trans('errors.image_not_found_details')); @@ -51,7 +48,7 @@ class ImageController extends Controller public function update(Request $request, string $id) { $this->validate($request, [ - 'name' => 'required|min:2|string', + 'name' => ['required', 'min:2', 'string'], ]); $image = $this->imageRepo->getById($id);