From 5519e3d5d3311275a6fb2aa4962f9cea1626996c Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Tue, 1 Feb 2011 13:07:37 -0500 Subject: Better logic handling for 404 override --- system/core/CodeIgniter.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'system') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 0414ffbf1..567e67f65 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -295,6 +295,17 @@ $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.EXT)) + { + show_404("{$class}/{$method}"); + } + + include_once(APPPATH.'controllers/'.$class.EXT); + unset($CI); + $CI = new $class(); + } } else { -- cgit v1.2.3-24-g4f1b