From 1cf89aab5fff8c8068cbf0ed18038b6e4fd4f605 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 3 Sep 2006 18:24:39 +0000 Subject: --- system/libraries/Router.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'system/libraries/Router.php') diff --git a/system/libraries/Router.php b/system/libraries/Router.php index 2219f5739..1c67113f6 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -219,15 +219,23 @@ class CI_Router { { return $segments; } - + // Is the controller in a sub-folder? if (is_dir(APPPATH.'controllers/'.$segments['0'])) - { + { // Set the directory and remove it from the segment array $this->set_directory($segments['0']); $segments = array_slice($segments, 1); - if (count($segments) == 0) + if (count($segments) > 0) + { + // Does the requested controller exist in the sub-folder? + if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$segments['0'].EXT)) + { + show_404(); + } + } + else { $this->set_class($this->default_controller); $this->set_method('index'); -- cgit v1.2.3-24-g4f1b