summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-07-31 10:10:33 +0200
committerGitHub <noreply@github.com>2020-07-31 10:10:33 +0200
commite19bbce7f6e243e0f42633008f4fad02f21732df (patch)
tree8fda8701c4e88cd36b6b1e0360037a9fd7bd9597 /lib
parent0aac884f38afda522fb047c3aff9a14470926412 (diff)
parentc2c9a6a0e17c5421c2a6941f7151cf05981636fa (diff)
downloadnextcloud-server-e19bbce7f6e243e0f42633008f4fad02f21732df.tar.gz
nextcloud-server-e19bbce7f6e243e0f42633008f4fad02f21732df.zip
Merge pull request #22060 from nextcloud/trashbin-s3-fixes
Object store trashbin fixes
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Cache/Updater.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/Files/Cache/Updater.php b/lib/private/Files/Cache/Updater.php
index b6a0e62a88a..79501d910e5 100644
--- a/lib/private/Files/Cache/Updater.php
+++ b/lib/private/Files/Cache/Updater.php
@@ -201,7 +201,11 @@ class Updater implements IUpdater {
$this->cache->moveFromCache($sourceCache, $source, $target);
}
- if (pathinfo($source, PATHINFO_EXTENSION) !== pathinfo($target, PATHINFO_EXTENSION) && $sourceInfo->getMimeType() !== FileInfo::MIMETYPE_FOLDER) {
+ $sourceExtension = pathinfo($source, PATHINFO_EXTENSION);
+ $targetExtension = pathinfo($target, PATHINFO_EXTENSION);
+ $targetIsTrash = preg_match("/d\d+/", $targetExtension);
+
+ if ($sourceExtension !== $targetExtension && $sourceInfo->getMimeType() !== FileInfo::MIMETYPE_FOLDER && !$targetIsTrash) {
// handle mime type change
$mimeType = $this->storage->getMimeType($target);
$fileId = $this->cache->getId($target);