1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Enabled session in 404 responses

Fixes #634
This commit is contained in:
Dan Brown
2017-12-28 13:19:02 +00:00
parent 8b160b9fb4
commit afe781bc39
6 changed files with 55 additions and 5 deletions

View File

@ -145,6 +145,7 @@ class PageController extends Controller
* @param string $bookSlug
* @param string $pageSlug
* @return Response
* @throws NotFoundException
*/
public function show($bookSlug, $pageSlug)
{
@ -152,7 +153,7 @@ class PageController extends Controller
$page = $this->entityRepo->getBySlug('page', $pageSlug, $bookSlug);
} catch (NotFoundException $e) {
$page = $this->entityRepo->getPageByOldSlug($pageSlug, $bookSlug);
if ($page === null) abort(404);
if ($page === null) throw $e;
return redirect($page->getUrl());
}