Commits

Eric Barnes committed 68da135

Better logic handling for 404 override

  • Participants
  • Parent commits aa8171e

Comments (0)

Files changed (1)

File system/core/CodeIgniter.php

 				$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
 			{