X-Git-Url: http://git.onelab.eu/?p=www-register-wizard.git;a=blobdiff_plain;f=libraries%2FRouter.php;h=50c7dd7cc2a52859fba32acfec667914a33af6a5;hp=32de58dbf5426cadd18d3a0e12d85ae0f0a366d3;hb=47598daa8c32dbbd72db83dc33f2ce91b3f6f7b0;hpb=4afb2fe256f094a1caf6bff14f51c6a88938cc9f diff --git a/libraries/Router.php b/libraries/Router.php index 32de58d..50c7dd7 100644 --- a/libraries/Router.php +++ b/libraries/Router.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2009, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 @@ -97,18 +97,22 @@ class CI_Router { { show_error("Unable to determine what should be displayed. A default route has not been specified in the routing file."); } + + if (strpos($this->default_controller, '/') !== FALSE) + { + $x = explode('/', $this->default_controller); - // Turn the default route into an array. We explode it in the event that - // the controller is located in a subfolder - $segments = $this->_validate_request(explode('/', $this->default_controller)); + $this->set_class(end($x)); + $this->set_method('index'); + $this->_set_request($x); + } + else + { + $this->set_class($this->default_controller); + $this->set_method('index'); + $this->_set_request(array($this->default_controller, 'index')); + } - // Set the class and method - $this->set_class($segments[0]); - $this->set_method('index'); - - // Assign the segments to the URI class - $this->uri->rsegments = $segments; - // re-index the routed segments array so it starts with 1 rather than 0 $this->uri->_reindex_segments(); @@ -144,7 +148,7 @@ class CI_Router { * @return void */ function _set_request($segments = array()) - { + { $segments = $this->_validate_request($segments); if (count($segments) == 0)