diff --git a/lib/private/files/storage/common.php b/lib/private/files/storage/common.php index edc570c967..1d4801e5b9 100644 --- a/lib/private/files/storage/common.php +++ b/lib/private/files/storage/common.php @@ -613,6 +613,10 @@ abstract class Common implements Storage, ILockingStorage { return $this->rename($sourceInternalPath, $targetInternalPath); } + if (!$sourceStorage->isDeletable($sourceInternalPath)) { + return false; + } + $result = $this->copyFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath, true); if ($result) { if ($sourceStorage->is_dir($sourceInternalPath)) { diff --git a/lib/private/files/storage/wrapper/encryption.php b/lib/private/files/storage/wrapper/encryption.php index 26905dfb38..11c6084d00 100644 --- a/lib/private/files/storage/wrapper/encryption.php +++ b/lib/private/files/storage/wrapper/encryption.php @@ -459,6 +459,10 @@ class Encryption extends Wrapper { // - copy the copyKeys() call from $this->copyBetweenStorage to this method // - remove $this->copyBetweenStorage + if (!$sourceStorage->isDeletable($sourceInternalPath)) { + return false; + } + $result = $this->copyBetweenStorage($sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime, true); if ($result) { if ($sourceStorage->is_dir($sourceInternalPath)) {