mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 01:36:00 -04:00
Allow book, shelf, settings & profile form input validation to skip image
This commit is contained in:
parent
d3737d5a87
commit
57f587a78b
@ -86,7 +86,7 @@ class BookController 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->getImageValidationRules(),
|
'image' => 'nullable|' . $this->getImageValidationRules(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$bookshelf = null;
|
$bookshelf = null;
|
||||||
@ -153,7 +153,7 @@ class BookController 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->getImageValidationRules(),
|
'image' => 'nullable|' . $this->getImageValidationRules(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$book = $this->bookRepo->update($book, $request->all());
|
$book = $this->bookRepo->update($book, $request->all());
|
||||||
|
@ -85,7 +85,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->getImageValidationRules(),
|
'image' => 'nullable|' . $this->getImageValidationRules(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$bookIds = explode(',', $request->get('books', ''));
|
$bookIds = explode(',', $request->get('books', ''));
|
||||||
@ -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->getImageValidationRules(),
|
'image' => 'nullable|' . $this->getImageValidationRules(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
@ -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->getImageValidationRules(),
|
'app_logo' => 'nullable|' . $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->getImageValidationRules(),
|
'profile_image' => 'nullable|' . $this->getImageValidationRules(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$user = $this->userRepo->getById($id);
|
$user = $this->userRepo->getById($id);
|
||||||
|
Loading…
Reference in New Issue
Block a user