diff options
author | Eric Barnes <eric@ericlbarnes.com> | 2011-01-31 03:17:11 +0100 |
---|---|---|
committer | Eric Barnes <eric@ericlbarnes.com> | 2011-01-31 03:17:11 +0100 |
commit | c5bf616c68ab4d18777ba77d5eaf07384b392f78 (patch) | |
tree | 8f7f0d69b66b967fca77d015c281833d54443559 /system/core/CodeIgniter.php | |
parent | c7f2bd28a8b26a6ed61f83f1d75fdd78aa37ebfe (diff) |
Added 404_override to Codeigniter file to catch the 404 if the controller is available but no method. Fixes #19
Diffstat (limited to 'system/core/CodeIgniter.php')
-rw-r--r-- | system/core/CodeIgniter.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 2d3f24958..0414ffbf1 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -80,7 +80,7 @@ { get_config(array('subclass_prefix' => $assign_to_config['subclass_prefix'])); } - + /* * ------------------------------------------------------ * Set a liberal script execution time limit @@ -289,7 +289,17 @@ // methods, so we'll use this workaround for consistent behavior if ( ! in_array(strtolower($method), array_map('strtolower', get_class_methods($CI)))) { - show_404("{$class}/{$method}"); + // Check and see if we are using a 404 override and use it. + if ( ! empty($RTR->routes['404_override'])) + { + $x = explode('/', $RTR->routes['404_override']); + $class = $x[0]; + $method = (isset($x[1]) ? $x[1] : 'index'); + } + else + { + show_404("{$class}/{$method}"); + } } // Call the requested method. |