From a4825200a48dd2f93afe47a850b7bca18ff4c593 Mon Sep 17 00:00:00 2001 From: Tezza Date: Sun, 1 Mar 2015 14:39:34 +0100 Subject: [PATCH] limiting redirects to 404s --- src/app/app.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/app/app.php b/src/app/app.php index 671b2c1..b632059 100644 --- a/src/app/app.php +++ b/src/app/app.php @@ -30,14 +30,10 @@ $app->mount( '/events', new level2\EventsControllerProvider() ); $app->error(function (\Exception $e, $code) use ( $app ) { - switch ($code) { - case 404: - return $app->redirect('/'); - default: - $message = 'We are sorry, but something went terribly wrong.'; - } - + if ( $code == 404 ) { + return $app->redirect('/'); return new Response($message); + } }); return $app;