From 102c6ffc41ad6fb70b07776b80b4c53528a6abc8 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Tue, 16 Jun 2015 11:40:27 +0200 Subject: Normalize path in View's lock methods --- lib/private/files/view.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/private/files') diff --git a/lib/private/files/view.php b/lib/private/files/view.php index 1d4654e11fc..39e2fe6bfce 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -1683,6 +1683,7 @@ class View { */ private function lockPath($path, $type) { $absolutePath = $this->getAbsolutePath($path); + $absolutePath = Filesystem::normalizePath($absolutePath); if (!$this->shouldLockFile($absolutePath)) { return false; } @@ -1717,6 +1718,7 @@ class View { */ public function changeLock($path, $type) { $absolutePath = $this->getAbsolutePath($path); + $absolutePath = Filesystem::normalizePath($absolutePath); if (!$this->shouldLockFile($absolutePath)) { return false; } @@ -1750,6 +1752,7 @@ class View { */ private function unlockPath($path, $type) { $absolutePath = $this->getAbsolutePath($path); + $absolutePath = Filesystem::normalizePath($absolutePath); if (!$this->shouldLockFile($absolutePath)) { return false; } @@ -1774,9 +1777,8 @@ class View { * @return bool False if the path is excluded from locking, true otherwise */ public function lockFile($path, $type) { - $path = '/' . trim($path, '/'); - $absolutePath = $this->getAbsolutePath($path); + $absolutePath = Filesystem::normalizePath($absolutePath); if (!$this->shouldLockFile($absolutePath)) { return false; } @@ -1799,9 +1801,8 @@ class View { * @return bool False if the path is excluded from locking, true otherwise */ public function unlockFile($path, $type) { - $path = rtrim($path, '/'); - $absolutePath = $this->getAbsolutePath($path); + $absolutePath = Filesystem::normalizePath($absolutePath); if (!$this->shouldLockFile($absolutePath)) { return false; } -- cgit v1.2.3