summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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..9b31a646b 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;
+ }
+
+ $slen = strlen($suffix);
+
+ if (substr($this->uri_string, -$slen) === $suffix)
+ {
+ $this->uri_string = substr($this->uri_string, 0, -$slen);
}
}