summaryrefslogtreecommitdiffstats
path: root/system/core/URI.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2013-01-11 20:37:39 +0100
committerAndrey Andreev <narf@bofh.bg>2013-01-11 20:37:39 +0100
commit78fa58a66f4e0d31043f0d3d8a64088fb8900361 (patch)
tree069ff59dd399f27413ae9d9f5311d126b1fa2e7c /system/core/URI.php
parent5b5401a78403fce9a32acd912686b5e6cdba15b7 (diff)
parentd1e50fa4ae25a8e60a13f06e6debbca1b2749fce (diff)
Merge pull request #2145 from vlakoff/develop
URI->_remove_url_suffix() : suffix has to be at the end of uri_string
Diffstat (limited to 'system/core/URI.php')
-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);
}
}