summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvlakoff <vlakoff@gmail.com>2013-01-11 15:22:17 +0100
committervlakoff <vlakoff@gmail.com>2013-01-11 15:22:17 +0100
commitd1e50fa4ae25a8e60a13f06e6debbca1b2749fce (patch)
treefa45abc79acd4dd5fccc8d7b0f2d3fdf1500c2a5
parent661f588a010fd9203d542398e04997902405c122 (diff)
URI->_remove_url_suffix() : more efficient code
related to #2135
-rw-r--r--system/core/URI.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/system/core/URI.php b/system/core/URI.php
index 8d0d8fddc..9b31a646b 100644
--- a/system/core/URI.php
+++ b/system/core/URI.php
@@ -358,11 +358,11 @@ class CI_URI {
return;
}
- $offset = strrpos($this->uri_string, $suffix);
+ $slen = strlen($suffix);
- if ($offset !== FALSE && $offset === strlen($this->uri_string) - strlen($suffix))
+ if (substr($this->uri_string, -$slen) === $suffix)
{
- $this->uri_string = substr($this->uri_string, 0, $offset);
+ $this->uri_string = substr($this->uri_string, 0, -$slen);
}
}