summaryrefslogtreecommitdiffstats
path: root/lib/private/files
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@karoshi.org.uk>2015-01-09 13:54:17 +0000
committerRobin McCorkell <rmccorkell@karoshi.org.uk>2015-01-09 13:54:17 +0000
commit631d6571fdb39c367406fba8c608c76c92b06e2a (patch)
tree077cc764ff82dfb5b1c8453963cf870d04806b5d /lib/private/files
parent800738f51a1031839711b53d6859b0ce188a8b4c (diff)
parent888ce4d4f9272016a033c859850808f3e1643da9 (diff)
downloadnextcloud-server-631d6571fdb39c367406fba8c608c76c92b06e2a.tar.gz
nextcloud-server-631d6571fdb39c367406fba8c608c76c92b06e2a.zip
Merge pull request #13181 from owncloud/filecache-preventleadingslash
Trim leading or trailing slashes in file cache paths
Diffstat (limited to 'lib/private/files')
-rw-r--r--lib/private/files/cache/cache.php2
-rw-r--r--lib/private/files/cache/wrapper/cachejail.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/files/cache/cache.php b/lib/private/files/cache/cache.php
index 9df64db7f07..bf44cf48aa7 100644
--- a/lib/private/files/cache/cache.php
+++ b/lib/private/files/cache/cache.php
@@ -699,6 +699,6 @@ class Cache {
*/
public function normalize($path) {
- return \OC_Util::normalizeUnicode($path);
+ return trim(\OC_Util::normalizeUnicode($path), '/');
}
}
diff --git a/lib/private/files/cache/wrapper/cachejail.php b/lib/private/files/cache/wrapper/cachejail.php
index f4ffc67d76a..3f7ea66ea1b 100644
--- a/lib/private/files/cache/wrapper/cachejail.php
+++ b/lib/private/files/cache/wrapper/cachejail.php
@@ -30,7 +30,7 @@ class CacheJail extends CacheWrapper {
if ($path === '') {
return $this->root;
} else {
- return $this->root . '/' . $path;
+ return $this->root . '/' . ltrim($path, '/');
}
}