summaryrefslogtreecommitdiffstats
path: root/apps/workflowengine
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2021-02-23 17:34:05 +0100
committerVincent Petry <vincent@nextcloud.com>2022-12-20 13:28:40 +0100
commit83cc8202b8b99457e6cb0731adf5bf0ea27beebe (patch)
tree6a311558abdf9c4a805f1bf6135600542438d425 /apps/workflowengine
parentc5a82467429e5e09b740009d19758a3df38a7f4d (diff)
downloadnextcloud-server-83cc8202b8b99457e6cb0731adf5bf0ea27beebe.tar.gz
nextcloud-server-83cc8202b8b99457e6cb0731adf5bf0ea27beebe.zip
remove file exists check from `cacheAndReturnMimeType`
the method is only called if the file exists already a check against storing the fallback mimetype is added as a safety instead Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/workflowengine')
-rw-r--r--apps/workflowengine/lib/Check/FileMimeType.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/workflowengine/lib/Check/FileMimeType.php b/apps/workflowengine/lib/Check/FileMimeType.php
index 8213010af05..991d7ebc739 100644
--- a/apps/workflowengine/lib/Check/FileMimeType.php
+++ b/apps/workflowengine/lib/Check/FileMimeType.php
@@ -77,7 +77,7 @@ class FileMimeType extends AbstractStringCheck implements IFileCheck {
}
/**
- * The mimetype is only cached if the file exists. Otherwise files access
+ * The mimetype is only cached if the file has a valid mimetype. Otherwise files access
* control will cache "application/octet-stream" for all the target node on:
* rename, move, copy and all other methods which create a new item
*
@@ -92,7 +92,7 @@ class FileMimeType extends AbstractStringCheck implements IFileCheck {
* @return string
*/
protected function cacheAndReturnMimeType(string $storageId, ?string $path, string $mimeType): string {
- if ($path !== null && $this->storage->file_exists($path)) {
+ if ($path !== null && $mimeType !== 'application/octet-stream') {
$this->mimeType[$storageId][$path] = $mimeType;
}