Merge pull request #29457 from nextcloud/backport/29454/stable20

pull/29417/head
Julius Härtl 3 years ago committed by GitHub
commit 2835f62410
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -122,7 +122,7 @@ class FileMimeType extends AbstractStringCheck implements IFileCheck {
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);

Loading…
Cancel
Save