diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2015-07-21 11:06:09 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2015-07-21 11:06:09 +0200 |
commit | 2bc2e974b22b4c8545bb3d046ad2d6ed36d50f43 (patch) | |
tree | 5be7b9df0682a340bbd4dfbfda98ba1d687c2f01 /apps/encryption/lib/migration.php | |
parent | 2ecba9e5a58d3ae3ebce4751fad5d896f8dac308 (diff) | |
parent | dc6cc57e11559b0a8afd4223c38f22a445b1f68f (diff) | |
download | nextcloud-server-2bc2e974b22b4c8545bb3d046ad2d6ed36d50f43.tar.gz nextcloud-server-2bc2e974b22b4c8545bb3d046ad2d6ed36d50f43.zip |
Merge pull request #17752 from owncloud/enc_migration_fix_mountpoint_detection_8.1
[8.1 backport] fix system wide mount point detection on migration
Diffstat (limited to 'apps/encryption/lib/migration.php')
-rw-r--r-- | apps/encryption/lib/migration.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/encryption/lib/migration.php b/apps/encryption/lib/migration.php index 0903587e879..e6887e8cc07 100644 --- a/apps/encryption/lib/migration.php +++ b/apps/encryption/lib/migration.php @@ -283,7 +283,7 @@ class Migration { $this->renameFileKeys($user, $path . '/' . $file, $trash); } else { $target = $this->getTargetDir($user, $path, $file, $trash); - if ($target) { + if ($target !== false) { $this->createPathForKeys(dirname($target)); $this->view->rename($user . '/' . $path . '/' . $file, $target); } else { @@ -303,6 +303,7 @@ class Migration { * get system mount points * wrap static method so that it can be mocked for testing * + * @internal * @return array */ protected function getSystemMountPoints() { @@ -329,10 +330,11 @@ class Migration { if ($user === '') { // for system wide mounts we need to check if the mount point really exists - $normalized = trim($filePath, '/'); + $normalized = \OC\Files\Filesystem::normalizePath($filePath); $systemMountPoints = $this->getSystemMountPoints(); foreach ($systemMountPoints as $mountPoint) { - if (strpos($normalized, $mountPoint['mountpoint']) === 0) + $normalizedMountPoint = \OC\Files\Filesystem::normalizePath($mountPoint['mountpoint']) . '/'; + if (strpos($normalized, $normalizedMountPoint) === 0) return $targetDir; } } else if ($trash === false && $this->view->file_exists('/' . $user. '/files/' . $filePath)) { |