summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2008-01-19 18:12:31 +0100
committerDerek Jones <derek.jones@ellislab.com>2008-01-19 18:12:31 +0100
commit500b9d3af54b6c4d221bf148206307988abc4420 (patch)
tree5acaf928368235a519af94d024955c3a6bd845b1 /system
parentbab7ed9f660ef16f48cd9cf299e6e440b3f1d75c (diff)
Fixed bug #3268 where router could leave '/' as the path
Diffstat (limited to 'system')
-rw-r--r--system/libraries/URI.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/system/libraries/URI.php b/system/libraries/URI.php
index 139b52b5d..5aafbb4cd 100644
--- a/system/libraries/URI.php
+++ b/system/libraries/URI.php
@@ -78,7 +78,7 @@ class CI_URI {
// Is there a PATH_INFO variable?
// Note: some servers seem to have trouble with getenv() so we'll test it two ways
$path = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO');
- if ($path != '' AND $path != "/".SELF)
+ if ($path != '' AND $path != '/' AND $path != "/".SELF)
{
$this->uri_string = $path;
return;
@@ -86,7 +86,7 @@ class CI_URI {
// No PATH_INFO?... What about QUERY_STRING?
$path = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : @getenv('QUERY_STRING');
- if ($path != '')
+ if ($path != '' AND $path != '/')
{
$this->uri_string = $path;
return;
@@ -94,7 +94,7 @@ class CI_URI {
// No QUERY_STRING?... Maybe the ORIG_PATH_INFO variable exists?
$path = (isset($_SERVER['ORIG_PATH_INFO'])) ? $_SERVER['ORIG_PATH_INFO'] : @getenv('ORIG_PATH_INFO');
- if ($path != '' AND $path != "/".SELF)
+ if ($path != '' AND $path != '/' AND $path != "/".SELF)
{
$this->uri_string = $path;
return;
@@ -187,14 +187,15 @@ class CI_URI {
*/
function _filter_uri($str)
{
- if ($this->config->item('permitted_uri_chars') != '')
+ if ($str != '' AND $this->config->item('permitted_uri_chars') != '')
{
if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str))
{
exit('The URI you submitted has disallowed characters.');
}
- }
- return $str;
+ }
+
+ return $str;
}
// --------------------------------------------------------------------