diff options
author | Eric Barnes <eric@ericlbarnes.com> | 2011-04-18 05:45:41 +0200 |
---|---|---|
committer | Eric Barnes <eric@ericlbarnes.com> | 2011-04-18 05:45:41 +0200 |
commit | 26eebddda5438c3967bad74a05c3e990528e1182 (patch) | |
tree | 7e474cc899404cbb70faffc38bf86fa271d4821b | |
parent | 9e2679849611ce050f5636c44b6c3279328d00f9 (diff) |
Changed server check to ensure SCRIPT_NAME is defined. Fixes #57
-rw-r--r-- | system/core/URI.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/system/core/URI.php b/system/core/URI.php index 80dc62e58..d56548654 100644 --- a/system/core/URI.php +++ b/system/core/URI.php @@ -120,7 +120,7 @@ class CI_URI { $path = (isset($_SERVER[$uri])) ? $_SERVER[$uri] : @getenv($uri); $this->_set_uri_string($path); } - + // -------------------------------------------------------------------- /** @@ -133,7 +133,7 @@ class CI_URI { { // Filter out control characters $str = remove_invisible_characters($str, FALSE); - + // If the URI contains only a slash we'll kill it $this->uri_string = ($str == '/') ? '' : $str; } @@ -151,7 +151,7 @@ class CI_URI { */ private function _detect_uri() { - if ( ! isset($_SERVER['REQUEST_URI'])) + if ( ! isset($_SERVER['REQUEST_URI']) OR ! isset($_SERVER['SCRIPT_NAME'])) { return ''; } @@ -184,12 +184,12 @@ class CI_URI { $_SERVER['QUERY_STRING'] = ''; $_GET = array(); } - + if ($uri == '/' || empty($uri)) { return '/'; } - + $uri = parse_url($uri, PHP_URL_PATH); // Do some final cleaning of the URI and return it |