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

deleted files, fix mimetype detection
This commit is contained in:
Roeland Jago Douma 2016-09-10 14:42:06 +02:00 committed by GitHub
commit ef4eaaee17
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' => '',