X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/d676e1e824e0377cfcb1736dd1ff622e383d8d02..aad2f54c159c22d7199afa452fabcb83bdbf097c:/app/Http/Controllers/BookshelfController.php diff --git a/app/Http/Controllers/BookshelfController.php b/app/Http/Controllers/BookshelfController.php index ce2e508c8..a294bf731 100644 --- a/app/Http/Controllers/BookshelfController.php +++ b/app/Http/Controllers/BookshelfController.php @@ -87,6 +87,7 @@ class BookshelfController extends Controller 'name' => ['required', 'string', 'max:255'], 'description' => ['string', 'max:1000'], 'image' => array_merge(['nullable'], $this->getImageValidationRules()), + 'tags' => ['array'], ]); $bookIds = explode(',', $request->get('books', '')); @@ -163,11 +164,12 @@ class BookshelfController extends Controller 'name' => ['required', 'string', 'max:255'], 'description' => ['string', 'max:1000'], 'image' => array_merge(['nullable'], $this->getImageValidationRules()), + 'tags' => ['array'], ]); if ($request->has('image_reset')) { $validated['image'] = null; - } else if (is_null($validated['image'])) { + } elseif (array_key_exists('image', $validated) && is_null($validated['image'])) { unset($validated['image']); }