summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/libraries/URI.php13
-rw-r--r--user_guide/changelog.html1
2 files changed, 8 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;
}
// --------------------------------------------------------------------
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index 07a605e4e..74068ef35 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -147,6 +147,7 @@ Change Log
<h3>Bug fixes for Version 1.6.0</h3>
<ul>
+ <li>Fixed a bug (#3268) where the Router could leave '/' as the path.</li>
<li>Fixed a bug in <kbd>highlight_phrase()</kbd> that caused an error with slashes.</li>
<li>Fixed a bug: $field_names[] vs $Ffield_names[] in postgre and sqlite drivers.</li>
<li>Fixed a bug in the <a href="./libraries/file_uploading.html">upload library</a> when allowed_files wasn't defined.</li>