diff options
author | admin <devnull@localhost> | 2006-09-03 20:24:39 +0200 |
---|---|---|
committer | admin <devnull@localhost> | 2006-09-03 20:24:39 +0200 |
commit | 1cf89aab5fff8c8068cbf0ed18038b6e4fd4f605 (patch) | |
tree | 18ee7e5d935161e64460f55a1ce8ddceb2cbe046 /system/libraries/Router.php | |
parent | 6ac4bea2da9e64fb0b434f52177353f6bd65b8e6 (diff) |
Diffstat (limited to 'system/libraries/Router.php')
-rw-r--r-- | system/libraries/Router.php | 14 |
1 files changed, 11 insertions, 3 deletions
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'); |