You are here

function hosting_path_normalize in Hostmaster (Aegir) 6

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 modules/hosting/platform/hosting_platform.module
Implementation of hook_validate().

File

modules/hosting/hosting.inc, line 69
General purpose Hosting module functions.

Code

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