From cd903fc0ceafa562b7496481468cb06f680be03c Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 28 Jun 2011 20:11:05 -0500 Subject: [PATCH] tweaked uri determination. --- system/request.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/system/request.php b/system/request.php index 0252232d..70986c41 100644 --- a/system/request.php +++ b/system/request.php @@ -53,7 +53,7 @@ public static function uri() } // ------------------------------------------------------- - // Remove the application URL and any extra slashes. + // Remove the application URL. // ------------------------------------------------------- $base_url = parse_url(Config::get('application.url'), PHP_URL_PATH); @@ -62,18 +62,18 @@ public static function uri() $uri = (string) substr($uri, strlen($base_url)); } - $uri = trim($uri, '/'); - // ------------------------------------------------------- - // Remove the application index. + // Remove the application index and any extra slashes. // ------------------------------------------------------- $index = Config::get('application.index'); - if (strpos($uri, $index) === 0) + if (strpos($uri, '/'.$index) === 0) { - $uri = (string) substr($uri, strlen($index)); + $uri = (string) substr($uri, strlen('/'.$index)); } + $uri = trim($uri, '/'); + // ------------------------------------------------------- // If the requests is to the root of the application, we // always return a single forward slash.