diff options
author | Sam Tuke <samtuke@owncloud.com> | 2013-02-05 15:37:40 +0000 |
---|---|---|
committer | Sam Tuke <samtuke@owncloud.com> | 2013-02-05 15:37:40 +0000 |
commit | 50faddfa409f7afbb2a41fddaf9ce117e06d16d0 (patch) | |
tree | 88fc95995b4200d952ef44bbbc069ffc423958df /lib/files/filesystem.php | |
parent | 53248a9b6069f64662e259053684c175498fe67d (diff) | |
download | nextcloud-server-50faddfa409f7afbb2a41fddaf9ce117e06d16d0.tar.gz nextcloud-server-50faddfa409f7afbb2a41fddaf9ce117e06d16d0.zip |
Minor improvement to comments
Diffstat (limited to 'lib/files/filesystem.php')
-rw-r--r-- | lib/files/filesystem.php | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/files/filesystem.php b/lib/files/filesystem.php index 65d9ffab485..71bf3d8708d 100644 --- a/lib/files/filesystem.php +++ b/lib/files/filesystem.php @@ -527,8 +527,7 @@ class Filesystem { } /** - * normalize a path - * + * @brief Fix common problems with a file path * @param string $path * @param bool $stripTrailingSlash * @return string @@ -537,21 +536,21 @@ class Filesystem { if ($path == '') { return '/'; } -//no windows style slashes + //no windows style slashes $path = str_replace('\\', '/', $path); -//add leading slash + //add leading slash if ($path[0] !== '/') { $path = '/' . $path; } -//remove duplicate slashes + //remove duplicate slashes while (strpos($path, '//') !== false) { $path = str_replace('//', '/', $path); } -//remove trailing slash + //remove trailing slash if ($stripTrailingSlash and strlen($path) > 1 and substr($path, -1, 1) === '/') { $path = substr($path, 0, -1); } -//normalize unicode if possible + //normalize unicode if possible if (class_exists('Normalizer')) { $path = \Normalizer::normalize($path); } |