mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-08-27 12:41:58 +00:00
Remove redundant getImageValidationRules method
This commit is contained in:
parent
5cd56f63ff
commit
d3737d5a87
@ -146,7 +146,7 @@ class BookshelfController extends Controller
|
|||||||
$this->validate($request, [
|
$this->validate($request, [
|
||||||
'name' => 'required|string|max:255',
|
'name' => 'required|string|max:255',
|
||||||
'description' => 'string|max:1000',
|
'description' => 'string|max:1000',
|
||||||
'image' => $this->imageRepo->getImageValidationRules(),
|
'image' => $this->getImageValidationRules(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ class GalleryImageController extends Controller
|
|||||||
{
|
{
|
||||||
$this->checkPermission('image-create-all');
|
$this->checkPermission('image-create-all');
|
||||||
$this->validate($request, [
|
$this->validate($request, [
|
||||||
'file' => $this->imageRepo->getImageValidationRules()
|
'file' => $this->getImageValidationRules()
|
||||||
]);
|
]);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -44,7 +44,7 @@ class SettingController extends Controller
|
|||||||
$this->preventAccessInDemoMode();
|
$this->preventAccessInDemoMode();
|
||||||
$this->checkPermission('settings-manage');
|
$this->checkPermission('settings-manage');
|
||||||
$this->validate($request, [
|
$this->validate($request, [
|
||||||
'app_logo' => $this->imageRepo->getImageValidationRules(),
|
'app_logo' => $this->getImageValidationRules(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Cycles through posted settings and update them
|
// Cycles through posted settings and update them
|
||||||
|
@ -155,7 +155,7 @@ class UserController extends Controller
|
|||||||
'password' => 'min:6|required_with:password_confirm',
|
'password' => 'min:6|required_with:password_confirm',
|
||||||
'password-confirm' => 'same:password|required_with:password',
|
'password-confirm' => 'same:password|required_with:password',
|
||||||
'setting' => 'array',
|
'setting' => 'array',
|
||||||
'profile_image' => $this->imageRepo->getImageValidationRules(),
|
'profile_image' => $this->getImageValidationRules(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$user = $this->userRepo->getById($id);
|
$user = $this->userRepo->getById($id);
|
||||||
|
@ -219,12 +219,4 @@ class ImageRepo
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the validation rules for image files.
|
|
||||||
*/
|
|
||||||
public function getImageValidationRules(): string
|
|
||||||
{
|
|
||||||
return 'image_extension|no_double_extension|mimes:jpeg,png,gif,bmp,webp,tiff';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user