dont update mimetype when moving to trash

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2020-07-30 16:11:45 +02:00
parent 142b6eb08f
commit 4e6719b28c
No known key found for this signature in database
GPG Key ID: 42B69D8A64526EFB
1 changed files with 5 additions and 1 deletions

View File

@ -201,7 +201,11 @@ class Updater implements IUpdater {
$this->cache->moveFromCache($sourceCache, $source, $target); $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 // handle mime type change
$mimeType = $this->storage->getMimeType($target); $mimeType = $this->storage->getMimeType($target);
$fileId = $this->cache->getId($target); $fileId = $this->cache->getId($target);