From 995310d62fceaa249ec7dbfae48d84480d48bbc7 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 11 Aug 2011 08:28:51 -0500 Subject: [PATCH] Fix bug that prevented route directory route files from loading in modules. --- system/routing/loader.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/system/routing/loader.php b/system/routing/loader.php index 55e426e1..0cb223c9 100644 --- a/system/routing/loader.php +++ b/system/routing/loader.php @@ -60,6 +60,14 @@ class Loader { array_push($segments, substr($segment, 0, strpos($segment, '.'))); } + // Shift the module name off of the beginning of the array so we can locate the + // appropriate route file. Since the module name will not be part of the directory + // structure, we need to get rid of it. + if (count($segments) > 0 and ACTIVE_MODULE !== 'application') + { + array_shift($segments); + } + // Work backwards through the URI segments until we find the deepest possible // matching route directory. Once we find it, we will return those routes. foreach (array_reverse($segments, true) as $key => $value)