Skip to content

Commit

Permalink
Merge pull request #29454 from nextcloud/bugfix/noid/detect-mimetype-…
Browse files Browse the repository at this point in the history
…by-content-only-with-content

Detect mimetype by content only with content
  • Loading branch information
blizzz authored Oct 27, 2021
2 parents 3f8ca99 + 7a6d559 commit 1666bb0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/workflowengine/lib/Check/FileMimeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ protected function getActualValue() {
return $this->cacheAndReturnMimeType($this->storage->getId(), $this->path, 'httpd/unix-directory');
}

if ($this->storage->file_exists($this->path)) {
if ($this->storage->file_exists($this->path) && $this->storage->filesize($this->path)) {
$path = $this->storage->getLocalFile($this->path);
$mimeType = $this->mimeTypeDetector->detectContent($path);
return $this->cacheAndReturnMimeType($this->storage->getId(), $this->path, $mimeType);
Expand Down

0 comments on commit 1666bb0

Please sign in to comment.