You are here

function hosting_path_normalize in Hosting 6.2

Same name and namespace in other branches
  1. 7.4 hosting.inc \hosting_path_normalize()
  2. 7.3 hosting.inc \hosting_path_normalize()

Make a path canonical.

This removes duplicate slashes, trailing slashes and /./ occurences. It does not (yet?) resolve .. instances.

1 call to hosting_path_normalize()
hosting_platform_validate in platform/hosting_platform.module
Implementation of hook_validate().

File

./hosting.inc, line 103
General purpose Hosting module functions.

Code

function hosting_path_normalize($path) {
  return rtrim(preg_replace('/(\\/\\/*\\.)?\\/\\/*/', '/', $path), '/');
}