Commit b7997a95 authored by Taylor Otwell's avatar Taylor Otwell

Tweaked request URI determination.

parent 1aa86d07
...@@ -53,7 +53,7 @@ class Request { ...@@ -53,7 +53,7 @@ class Request {
} }
// ------------------------------------------------------- // -------------------------------------------------------
// Remove the application URL. // Remove the application URL and any extra slashes.
// ------------------------------------------------------- // -------------------------------------------------------
$base_url = parse_url(Config::get('application.url'), PHP_URL_PATH); $base_url = parse_url(Config::get('application.url'), PHP_URL_PATH);
...@@ -62,10 +62,17 @@ class Request { ...@@ -62,10 +62,17 @@ class Request {
$uri = (string) substr($uri, strlen($base_url)); $uri = (string) substr($uri, strlen($base_url));
} }
$uri = trim($uri, '/');
// ------------------------------------------------------- // -------------------------------------------------------
// Remove the application index and any extra slashes. // Remove the application index.
// ------------------------------------------------------- // -------------------------------------------------------
$uri = trim(str_replace('/index.php', '', $uri), '/'); $index = Config::get('application.index');
if (strpos($uri, $index) === 0)
{
$uri = (string) substr($uri, strlen($index));
}
// ------------------------------------------------------- // -------------------------------------------------------
// If the requests is to the root of the application, we // If the requests is to the root of the application, we
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment