Fixed issue where books titles could be leaked via shelf home view

- Also added test to cover
Fixes #1425
This commit is contained in:
Dan Brown
2019-05-07 22:42:12 +01:00
parent 7ef059e254
commit 97ffbaa740
2 changed files with 34 additions and 0 deletions

View File

@ -67,6 +67,9 @@ class HomeController extends Controller
if ($homepageOption === 'bookshelves') {
$shelves = $this->entityRepo->getAllPaginated('bookshelf', 18, $commonData['sort'], $commonData['order']);
foreach ($shelves as $shelf) {
$shelf->books = $this->entityRepo->getBookshelfChildren($shelf);
}
$data = array_merge($commonData, ['shelves' => $shelves]);
return view('common.home-shelves', $data);
}