summaryrefslogtreecommitdiffstats
path: root/system/core
diff options
context:
space:
mode:
authorvlakoff <vlakoff@gmail.com>2013-01-10 16:26:59 +0100
committervlakoff <vlakoff@gmail.com>2013-01-10 16:28:36 +0100
commit661f588a010fd9203d542398e04997902405c122 (patch)
tree86bee2b7e681cb2e0b8e2f5e40aa590d96a304ca /system/core
parent55899a0ed6a2f5be1c9d800c39051c8c0ce8fcab (diff)
URI->_remove_url_suffix() : suffix has to be at the end of uri_string
related to #2135
Diffstat (limited to 'system/core')
-rw-r--r--system/core/URI.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/system/core/URI.php b/system/core/URI.php
index b3603bbb1..8d0d8fddc 100644
--- a/system/core/URI.php
+++ b/system/core/URI.php
@@ -353,9 +353,16 @@ class CI_URI {
{
$suffix = (string) $this->config->item('url_suffix');
- if ($suffix !== '' && ($offset = strrpos($this->uri_string, $suffix)) !== FALSE)
+ if ($suffix === '')
{
- $this->uri_string = substr_replace($this->uri_string, '', $offset, strlen($suffix));
+ return;
+ }
+
+ $offset = strrpos($this->uri_string, $suffix);
+
+ if ($offset !== FALSE && $offset === strlen($this->uri_string) - strlen($suffix))
+ {
+ $this->uri_string = substr($this->uri_string, 0, $offset);
}
}