Merge pull request #1367 from nextcloud/trash-detect-correct-mimetype-stable10

[stable10] deleted files, fix mimetype detection
This commit is contained in:
Morris Jobke 2016-09-13 11:50:26 +02:00 committed by GitHub
commit d7faff0b0d
1 changed files with 3 additions and 2 deletions

View File

@ -78,11 +78,12 @@ class Helper {
$originalPath = substr($originalPath, 0, -1);
}
}
$type = $entry->getMimeType() === ICacheEntry::DIRECTORY_MIMETYPE ? 'dir' : 'file';
$i = array(
'name' => $name,
'mtime' => $timestamp,
'mimetype' => $entry->getMimeType(),
'type' => $entry->getMimeType() === ICacheEntry::DIRECTORY_MIMETYPE ? 'dir' : 'file',
'mimetype' => $type === 'dir' ? 'httpd/unix-directory' : \OC::$server->getMimeTypeDetector()->detectPath($name),
'type' => $type,
'directory' => ($dir === '/') ? '' : $dir,
'size' => $entry->getSize(),
'etag' => '',