From d1e50fa4ae25a8e60a13f06e6debbca1b2749fce Mon Sep 17 00:00:00 2001 From: vlakoff Date: Fri, 11 Jan 2013 15:22:17 +0100 Subject: URI->_remove_url_suffix() : more efficient code related to #2135 --- system/core/URI.php | 6 +++--- 1 file 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); } } -- cgit v1.2.3-24-g4f1b