mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 00:32:29 -04:00
fix: Preserve file id when moving from object store even if encryption wrapper is present
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
27599ef45d
commit
e6275f8759
1 changed files with 15 additions and 4 deletions
|
|
@ -538,10 +538,21 @@ class Encryption extends Wrapper {
|
|||
|
||||
$result = $this->copyBetweenStorage($sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime, true);
|
||||
if ($result) {
|
||||
if ($sourceStorage->is_dir($sourceInternalPath)) {
|
||||
$result = $sourceStorage->rmdir($sourceInternalPath);
|
||||
} else {
|
||||
$result = $sourceStorage->unlink($sourceInternalPath);
|
||||
if ($sourceStorage->instanceOfStorage(ObjectStoreStorage::class)) {
|
||||
/** @var ObjectStoreStorage $sourceStorage */
|
||||
$sourceStorage->setPreserveCacheOnDelete(true);
|
||||
}
|
||||
try {
|
||||
if ($sourceStorage->is_dir($sourceInternalPath)) {
|
||||
$result = $sourceStorage->rmdir($sourceInternalPath);
|
||||
} else {
|
||||
$result = $sourceStorage->unlink($sourceInternalPath);
|
||||
}
|
||||
} finally {
|
||||
if ($sourceStorage->instanceOfStorage(ObjectStoreStorage::class)) {
|
||||
/** @var ObjectStoreStorage $sourceStorage */
|
||||
$sourceStorage->setPreserveCacheOnDelete(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
|
|
|
|||
Loading…
Reference in a new issue