diff options
author | Andrey Andreev <narf@bofh.bg> | 2013-01-11 20:37:39 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2013-01-11 20:37:39 +0100 |
commit | 78fa58a66f4e0d31043f0d3d8a64088fb8900361 (patch) | |
tree | 069ff59dd399f27413ae9d9f5311d126b1fa2e7c /system | |
parent | 5b5401a78403fce9a32acd912686b5e6cdba15b7 (diff) | |
parent | d1e50fa4ae25a8e60a13f06e6debbca1b2749fce (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')
-rw-r--r-- | system/core/URI.php | 11 |
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); } } |