diff options
author | Phil Sturgeon <email@philsturgeon.co.uk> | 2011-08-11 02:41:10 +0200 |
---|---|---|
committer | Phil Sturgeon <email@philsturgeon.co.uk> | 2011-08-11 02:41:10 +0200 |
commit | d33f91708f73735231f458090a478f1204480c30 (patch) | |
tree | ae56861471ef4a26e8cc062eae2ad539d262d667 /system/core/CodeIgniter.php | |
parent | 03a9599befa5c8967f70960eda40b5f2a65f75cb (diff) | |
parent | 6adfe636980da3a7b25e5b87ed8bcd1d008a1243 (diff) |
Merge pull request #38 from bubbafoley/develop
404_override route now works for missing controllers in subdirectories.
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}"); + } } /* |