diff options
author | admin <devnull@localhost> | 2006-08-26 21:28:37 +0200 |
---|---|---|
committer | admin <devnull@localhost> | 2006-08-26 21:28:37 +0200 |
commit | b071bb5a92aade551345a495fb13f5678f3978d0 (patch) | |
tree | 803575f71b327ad5782206331d82bf5c6dfc0cc0 /system/libraries/Router.php | |
parent | e07fbb376a741e21e69a182eada322c4d3b7e62e (diff) |
Diffstat (limited to 'system/libraries/Router.php')
-rw-r--r-- | system/libraries/Router.php | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/system/libraries/Router.php b/system/libraries/Router.php index 678145458..b28ead953 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -87,25 +87,31 @@ class CI_Router { // Fetch the URI string Depending on the server, // the URI will be available in one of two globals - switch ($this->config->item('uri_protocol')) + if ($this->config->item('uri_protocol') == 'auto') { - case 'path_info' : $this->uri_string = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO'); - break; - case 'query_string' : $this->uri_string = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : @getenv('QUERY_STRING'); - break; - default : - $path_info = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO'); - - if ($path_info != '' AND $path_info != "/".SELF) - { - $this->uri_string = $path_info; - } - else - { - $this->uri_string = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : @getenv('QUERY_STRING'); - } - break; + $path_info = getenv('PATH_INFO'); + if ($path_info != '' AND $path_info != "/".SELF) + { + $this->uri_string = $path_info; + } + else + { + $path_info = getenv('ORIG_PATH_INFO'); + if ($path_info != '' AND $path_info != "/".SELF) + { + $this->uri_string = $path_info; + } + else + { + $this->uri_string = getenv('QUERY_STRING'); + } + } + } + else + { + $this->uri_string = getenv(strtoupper($this->config->item('uri_protocol'))); } + // Is there a URI string? If not, the default controller specified // by the admin in the "routes" file will be shown. @@ -291,10 +297,7 @@ class CI_Router { // Loop through the route array looking for wildcards foreach (array_slice($this->routes, 1) as $key => $val) - { - if (count(explode('/', $key)) != $num) - continue; - + { // Convert wildcards to RegEx $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key)); |