From aa821ecc00f11b6382f6e033db18445d9e51d6b9 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Thu, 8 Jan 2015 19:43:02 +0100 Subject: Trim leading or trailing slashes in file cache paths --- lib/private/files/cache/cache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/private/files') 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), '/'); } } -- cgit v1.2.3 From 888ce4d4f9272016a033c859850808f3e1643da9 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Fri, 9 Jan 2015 10:18:32 +0100 Subject: Fix cache jail to not duplicate slashes --- lib/private/files/cache/wrapper/cachejail.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/private/files') 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, '/'); } } -- cgit v1.2.3