summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRick Ellis <rick.ellis@ellislab.com>2008-10-03 04:29:56 +0200
committerRick Ellis <rick.ellis@ellislab.com>2008-10-03 04:29:56 +0200
commit26bde91ef36cacd22772102d3083277bd937a60d (patch)
tree44f09f26b2d45219bf38238251597c444120bf1f
parent02b0c399244435f0aeaa710b1992c75964fac88b (diff)
When I fixed a bug that did not permit the default route to be in a sub-folder, I introducted a different bug (#5285), which this should fix
-rw-r--r--system/libraries/Router.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/system/libraries/Router.php b/system/libraries/Router.php
index f1923794e..cf425163d 100644
--- a/system/libraries/Router.php
+++ b/system/libraries/Router.php
@@ -98,7 +98,22 @@ class CI_Router {
show_error("Unable to determine what should be displayed. A default route has not been specified in the routing file.");
}
- $this->uri->uri_string = $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));
+
+ // 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();
+
+ log_message('debug', "No URI present. Default controller set.");
+ return;
}
unset($this->routes['default_controller']);