summaryrefslogtreecommitdiffstats
path: root/system/core/URI.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-06-16 18:54:33 +0200
committerAndrey Andreev <narf@bofh.bg>2012-06-16 18:54:33 +0200
commit95d78cf4f78c0fb685a789c280d106ab242318ef (patch)
tree89a2dd150db58c4465f3f40233e25c8a3a40b71a /system/core/URI.php
parentb089e15b1510de6b6a034631c80d3d5e830ff9f3 (diff)
Fix issue #999
Diffstat (limited to 'system/core/URI.php')
-rw-r--r--system/core/URI.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/system/core/URI.php b/system/core/URI.php
index 208d311a5..6a8b1a5ac 100644
--- a/system/core/URI.php
+++ b/system/core/URI.php
@@ -302,9 +302,11 @@ class CI_URI {
*/
public function _remove_url_suffix()
{
- if ($this->config->item('url_suffix') !== '')
+ $suffix = (string) $this->config->item('url_suffix');
+
+ if ($suffix !== '' && ($offset = strrpos($this->uri_string, $suffix)) !== FALSE)
{
- $this->uri_string = preg_replace('|'.preg_quote($this->config->item('url_suffix')).'$|', '', $this->uri_string);
+ $this->uri_string = substr_replace($this->uri_string, '', $offset, strlen($suffix));
}
}