summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2014-06-27 12:20:29 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2014-06-27 22:53:26 +0200
commit706a8ace5820135d79c9f3ea6cd0d773e8957a31 (patch)
treecf423264b2e388d96a42a84ba85dc83923c2f461
parent1a3e698294b4a78aa437ad1aaebc7553fca1589d (diff)
downloadnextcloud-server-706a8ace5820135d79c9f3ea6cd0d773e8957a31.tar.gz
nextcloud-server-706a8ace5820135d79c9f3ea6cd0d773e8957a31.zip
normalize path before comparison to make sure that we always find the mount point
-rw-r--r--apps/files_encryption/lib/util.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php
index ea2b1b10d63..eb18507b4d5 100644
--- a/apps/files_encryption/lib/util.php
+++ b/apps/files_encryption/lib/util.php
@@ -1493,10 +1493,11 @@ class Util {
* @return boolean
*/
public function isSystemWideMountPoint($path) {
+ $normalizedPath = ltrim($path, '/');
if (\OCP\App::isEnabled("files_external")) {
$mount = \OC_Mount_Config::getSystemMountPoints();
foreach ($mount as $mountPoint => $data) {
- if ($mountPoint == substr($path, 1, strlen($mountPoint))) {
+ if ($mountPoint == substr($normalizedPath, 0, strlen($mountPoint))) {
return true;
}
}