From 8f8c5f6dd4ff52f78191211ca00d79d0049b80e0 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sat, 18 Jun 2011 09:34:52 -0500 Subject: [PATCH] fix bug in route loader that caused exception to be thrown when 404 should have been shown. --- system/route/loader.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/system/route/loader.php b/system/route/loader.php index fdf1d52e..de694b30 100644 --- a/system/route/loader.php +++ b/system/route/loader.php @@ -18,16 +18,16 @@ class Loader { return require APP_PATH.'routes'.EXT; } + if ( ! file_exists(APP_PATH.'routes/home'.EXT)) + { + throw new \Exception("A [home] route file is required when using a route directory."); + } + // -------------------------------------------------------------- // If the request is to the root, load the "home" routes file. // -------------------------------------------------------------- if ($uri == '/') { - if ( ! file_exists(APP_PATH.'routes/home'.EXT)) - { - throw new \Exception("A [home] route file is required when using a route directory."); - } - return require APP_PATH.'routes/home'.EXT; } // -------------------------------------------------------------- @@ -39,7 +39,7 @@ class Loader { if ( ! file_exists(APP_PATH.'routes/'.$segments[0].EXT)) { - throw new \Exception("No route file defined for routes beginning with [".$segments[0]."]"); + return require APP_PATH.'routes/home'.EXT; } return array_merge(require APP_PATH.'routes/'.$segments[0].EXT, require APP_PATH.'routes/home'.EXT);