1
0
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:
Nicolas Lœuillet 2014-01-16 14:32:29 +01:00
parent 58c63911d7
commit 6f6e7e6dc0

View File

@ -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');