summaryrefslogtreecommitdiffstats
path: root/system/core/Router.php
diff options
context:
space:
mode:
authorShane Pearson <bubbafoley@gmail.com>2011-08-10 23:02:32 +0200
committerShane Pearson <bubbafoley@gmail.com>2011-08-10 23:02:32 +0200
commit664a9357cd36be2f8e673cae3643318a695de5fb (patch)
treeeef1b436f69976bdef98081baefc253e5696912b /system/core/Router.php
parent03a9599befa5c8967f70960eda40b5f2a65f75cb (diff)
404_override route now works for missing controllers in subdirectories and functions that fail the security check in CodeIgniter.php
Diffstat (limited to 'system/core/Router.php')
-rw-r--r--system/core/Router.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/system/core/Router.php b/system/core/Router.php
index 5e92a04b1..668ac0954 100644
--- a/system/core/Router.php
+++ b/system/core/Router.php
@@ -244,7 +244,20 @@ class CI_Router {
// Does the requested controller exist in the sub-folder?
if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$segments[0].'.php'))
{
- show_404($this->fetch_directory().$segments[0]);
+ if ( ! empty($this->routes['404_override']))
+ {
+ $x = explode('/', $this->routes['404_override']);
+
+ $this->set_directory('');
+ $this->set_class($x[0]);
+ $this->set_method(isset($x[1]) ? $x[1] : 'index');
+
+ return $x;
+ }
+ else
+ {
+ show_404($this->fetch_directory().$segments[0]);
+ }
}
}
else