Skip to content

Commit

Permalink
Fixed another path bug (this time for linux machines).
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelMackus committed Sep 28, 2011
1 parent 2146bde commit 1cfb52f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion system/libraries/URI.php
Expand Up @@ -154,9 +154,19 @@ function _parse_request_uri()

$parsed_uri = explode("/", $request_uri);

$base_url = "http"
. ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')? 's' : '')
. "://" . $_SERVER['HTTP_HOST']
. preg_replace('@/+$@','',
str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME']))
)
. '/';

$i = 0;
foreach(explode(DIRECTORY_SEPARATOR, $fc_path) as $segment)
foreach(explode('/', $base_url) as $segment)
{
if (!$segment)
continue;
if (isset($parsed_uri[$i]) && $segment == $parsed_uri[$i])
{
$i++;
Expand Down

0 comments on commit 1cfb52f

Please sign in to comment.