diff options
author | Shane Pearson <bubbafoley@gmail.com> | 2011-08-10 23:02:32 +0200 |
---|---|---|
committer | Shane Pearson <bubbafoley@gmail.com> | 2011-08-10 23:02:32 +0200 |
commit | 664a9357cd36be2f8e673cae3643318a695de5fb (patch) | |
tree | eef1b436f69976bdef98081baefc253e5696912b /system/core/CodeIgniter.php | |
parent | 03a9599befa5c8967f70960eda40b5f2a65f75cb (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/CodeIgniter.php')
-rw-r--r-- | system/core/CodeIgniter.php | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 03b25ab9e..b49449005 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -267,7 +267,25 @@ OR in_array(strtolower($method), array_map('strtolower', get_class_methods('CI_Controller'))) ) { - show_404("{$class}/{$method}"); + if ( ! empty($RTR->routes['404_override'])) + { + $x = explode('/', $RTR->routes['404_override']); + $class = $x[0]; + $method = (isset($x[1]) ? $x[1] : 'index'); + if ( ! class_exists($class)) + { + if ( ! file_exists(APPPATH.'controllers/'.$class.'.php')) + { + show_404("{$class}/{$method}"); + } + + include_once(APPPATH.'controllers/'.$class.'.php'); + } + } + else + { + show_404("{$class}/{$method}"); + } } /* |