summaryrefslogtreecommitdiffstats
path: root/lib/files
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2013-02-05 09:58:35 -0800
committerLukas Reschke <lukas@statuscode.ch>2013-02-05 09:58:35 -0800
commite6400b305987977d867f1592f3231167903b70b1 (patch)
treeb6887ed778fd8660a98f04de36affc7a17547300 /lib/files
parent69fd3f42e51c8667b31cfc70f5c3777e3de484fa (diff)
parent20b1d12cbfc65b604acdaac84272f6af8b0d7be4 (diff)
downloadnextcloud-server-e6400b305987977d867f1592f3231167903b70b1.tar.gz
nextcloud-server-e6400b305987977d867f1592f3231167903b70b1.zip
Merge pull request #1474 from samtuke/master
Improvements to files_encryption
Diffstat (limited to 'lib/files')
-rw-r--r--lib/files/filesystem.php13
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);
}