summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-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);
}
}