Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated formatting and styleguide, thanks narfbg;

  • Loading branch information...
commit 0bf9cfa127516a5561155d70a8edfa3c6b0ec57b 1 parent af3bd3e
@chernjie chernjie authored
Showing with 13 additions and 7 deletions.
  1. +13 −7 system/core/URI.php
View
20 system/core/URI.php
@@ -219,23 +219,29 @@ protected function _parse_request_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);
Please sign in to comment.
Something went wrong with that request. Please try again.