From a26efbc2e38c2be7ef79bf59e4809d7073e58249 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 8 Aug 2011 09:44:57 -0500 Subject: [PATCH] Even more refactoring on the request class. --- system/request.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/system/request.php b/system/request.php index a3ddd08b..3ea419a2 100644 --- a/system/request.php +++ b/system/request.php @@ -29,11 +29,15 @@ class Request { $uri = static::raw_uri(); - $base = parse_url(Config::get('application.url'), PHP_URL_PATH); + if (strpos($uri, $base = parse_url(Config::get('application.url'), PHP_URL_PATH)) === 0) + { + $uri = substr($uri, strlen($base)); + } - if (strpos($uri, $base) === 0) $uri = substr($uri, strlen($base)); - - if (strpos($uri, $index = '/index.php') === 0) $uri = substr($uri, strlen($index)); + if (strpos($uri, $index = '/index.php') === 0) + { + $uri = substr($uri, strlen($index)); + } return static::$uri = (($uri = trim($uri, '/')) == '') ? '/' : $uri; }