]> source.dussan.org Git - nextcloud-server.git/commitdiff
non movable mounts can not be moved
authorRobin Appelman <robin@icewind.nl>
Mon, 3 Jul 2017 12:58:34 +0000 (14:58 +0200)
committerRobin Appelman <robin@icewind.nl>
Mon, 17 Jul 2017 13:40:45 +0000 (15:40 +0200)
Signed-off-by: Robin Appelman <robin@icewind.nl>
lib/private/Files/View.php

index 0e22415e6f735a6de31b0534b81946e330886f27..bc16511bdab06021911142caf841c0adc9d0fc2c 100644 (file)
@@ -779,14 +779,18 @@ class View {
                                $this->changeLock($path1, ILockingProvider::LOCK_EXCLUSIVE, true);
                                $this->changeLock($path2, ILockingProvider::LOCK_EXCLUSIVE, true);
 
-                               if ($internalPath1 === '' and $mount1 instanceof MoveableMount) {
-                                       if ($this->isTargetAllowed($absolutePath2)) {
-                                               /**
-                                                * @var \OC\Files\Mount\MountPoint | \OC\Files\Mount\MoveableMount $mount1
-                                                */
-                                               $sourceMountPoint = $mount1->getMountPoint();
-                                               $result = $mount1->moveMount($absolutePath2);
-                                               $manager->moveMount($sourceMountPoint, $mount1->getMountPoint());
+                               if ($internalPath1 === '') {
+                                       if ($mount1 instanceof MoveableMount) {
+                                               if ($this->isTargetAllowed($absolutePath2)) {
+                                                       /**
+                                                        * @var \OC\Files\Mount\MountPoint | \OC\Files\Mount\MoveableMount $mount1
+                                                        */
+                                                       $sourceMountPoint = $mount1->getMountPoint();
+                                                       $result = $mount1->moveMount($absolutePath2);
+                                                       $manager->moveMount($sourceMountPoint, $mount1->getMountPoint());
+                                               } else {
+                                                       $result = false;
+                                               }
                                        } else {
                                                $result = false;
                                        }