aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Node/Node.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Files/Node/Node.php')
-rw-r--r--lib/private/Files/Node/Node.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/private/Files/Node/Node.php b/lib/private/Files/Node/Node.php
index 41e8bf75242..dc025b79575 100644
--- a/lib/private/Files/Node/Node.php
+++ b/lib/private/Files/Node/Node.php
@@ -28,6 +28,7 @@
namespace OC\Files\Node;
use OC\Files\Filesystem;
+use OC\Files\Mount\MoveableMount;
use OCP\Files\FileInfo;
use OCP\Files\InvalidPathException;
use OCP\Files\NotFoundException;
@@ -415,7 +416,14 @@ class Node implements \OCP\Files\Node {
public function move($targetPath) {
$targetPath = $this->normalizePath($targetPath);
$parent = $this->root->get(dirname($targetPath));
- if ($parent instanceof Folder and $this->isValidPath($targetPath) and $parent->isCreatable()) {
+ if (
+ $parent instanceof Folder and
+ $this->isValidPath($targetPath) and
+ (
+ $parent->isCreatable() ||
+ ($parent->getInternalPath() === '' && $parent->getMountPoint() instanceof MoveableMount)
+ )
+ ) {
$nonExisting = $this->createNonExistingNode($targetPath);
$this->root->emit('\OC\Files', 'preRename', [$this, $nonExisting]);
$this->root->emit('\OC\Files', 'preWrite', [$nonExisting]);