mirror of
https://github.com/moparisthebest/wallabag
synced 2024-11-23 17:42:15 -05:00
[add] 404 if entry doesn't exist
This commit is contained in:
parent
58c63911d7
commit
6f6e7e6dc0
@ -12,6 +12,10 @@ $front->get('/view/{id}', function (Request $request, $id) use ($app) {
|
|||||||
|
|
||||||
$entry = $app['entry_api']->getEntryById($id);
|
$entry = $app['entry_api']->getEntryById($id);
|
||||||
|
|
||||||
|
if (empty($entry)) {
|
||||||
|
$app->abort(404, "Post $id does not exist.");
|
||||||
|
}
|
||||||
|
|
||||||
return $app['twig']->render('view.twig', array('entry' => $entry[0]));
|
return $app['twig']->render('view.twig', array('entry' => $entry[0]));
|
||||||
})
|
})
|
||||||
->bind('view_entry');
|
->bind('view_entry');
|
||||||
|
Loading…
Reference in New Issue
Block a user