diff options
author | CJ <chern.jie@mig33global.com> | 2012-12-06 10:15:49 +0100 |
---|---|---|
committer | CJ <chern.jie@mig33global.com> | 2012-12-06 10:15:49 +0100 |
commit | 0bf9cfa127516a5561155d70a8edfa3c6b0ec57b (patch) | |
tree | 3dfb679544ae12993f272f3b01644f528a07ba39 | |
parent | af3bd3e57fa7b381a670d3b96d9bb49d142739c8 (diff) |
Updated formatting and styleguide, thanks narfbg;
-rw-r--r-- | system/core/URI.php | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/system/core/URI.php b/system/core/URI.php index 3f8775d4e..07add5a4d 100644 --- a/system/core/URI.php +++ b/system/core/URI.php @@ -219,23 +219,29 @@ class CI_URI { } // Do some final cleaning of the URI and return it - return $this->_remove_relative_directory_str($uri); + return $this->_remove_relative_directory($uri); } // -------------------------------------------------------------------- /** * Remove relative directory (../) and multi slashes (///) - * @param string $url - * @return string + * + * Do some final cleaning of the URI and return it, currently only used in self::_parse_request_uri() + * + * @param string $url + * @return string */ - private function _remove_relative_directory_str($url) + protected function _remove_relative_directory($uri) { $uris = array(); - $tok = strtok($url, '/'); - while ($tok !== false) + $tok = strtok($uri, '/'); + while ($tok !== FALSE) { - ($tok != '..' && ! empty($tok) || $tok === '0') && $uris[] = $tok; + if (( ! empty($tok) OR $tok === '0') && $tok !== '..') + { + $uris[] = $tok; + } $tok = strtok('/'); } return implode('/', $uris); |