diff options
author | admin <devnull@localhost> | 2006-10-11 23:48:33 +0200 |
---|---|---|
committer | admin <devnull@localhost> | 2006-10-11 23:48:33 +0200 |
commit | 4c1ab6c826c3f5c3158a38443c2d3c30203f0f5a (patch) | |
tree | 00335e6bb3df2428d8a9cd878ca8a3b3b5f7d01f /system/libraries | |
parent | 75247ee81ed3e4b1248f9e5cf7efb41790bb4d3d (diff) |
Diffstat (limited to 'system/libraries')
-rw-r--r-- | system/libraries/Router.php | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/system/libraries/Router.php b/system/libraries/Router.php index dab84883e..ead1439f6 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -366,24 +366,30 @@ class CI_Router { */ function _parse_request_uri() { - if (($request_uri = getenv('REQUEST_URI')) == '') + if ( ! isset($_SERVER['REQUEST_URI']) OR $_SERVER['REQUEST_URI'] == '') { return ''; } - $fc_path = FCPATH; + $request_uri = preg_replace("|/(.*)|", "\\1", str_replace("\\", "/", $_SERVER['REQUEST_URI'])); + + if ($request_uri == '') + { + return ''; + } + $fc_path = FCPATH; if (strpos($request_uri, '?') !== FALSE) { $fc_path .= '?'; } - $parsed_uri = explode("/", preg_replace("|/(.*)|", "\\1", str_replace("\\", "/", $request_uri))); - + $parsed_uri = explode("/", $request_uri); + $i = 0; foreach(explode("/", $fc_path) as $segment) { - if ($segment == $parsed_uri[$i]) + if (isset($parsed_uri[$i]) AND $segment == $parsed_uri[$i]) { $i++; } |