Skip to content

Commit

Permalink
Check if 404_override controller is in a subfolder
Browse files Browse the repository at this point in the history
  • Loading branch information
pickupman committed Jan 18, 2012
1 parent 96db8f9 commit 1530187
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion system/core/CodeIgniter.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,16 @@ function &get_instance()
// If this include fails it means that the default controller in the Routes.php file is not resolving to something valid.
if ( ! file_exists(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().'.php'))
{
show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.');
// Check if 404_override controller is in a subfolder
if (file_exists(APPPATH.'controllers/'.$RTR->fetch_class().'/'.$RTR->fetch_class().'.php'))
{
$RTR->directory = $RTR->fetch_class().'/';
}
else
{
show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.');
}

}

include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().'.php');
Expand Down

0 comments on commit 1530187

Please sign in to comment.