Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
is_dir can be null on blacklisted files
Signed-off-by: KoKsPfLaNzE <[email protected]>
  • Loading branch information
kokspflanze authored and Backportbot committed Nov 27, 2019
commit 2a9699252f28cf149ce99a1e7327a2e098616c74
4 changes: 2 additions & 2 deletions lib/Controller/APIv2.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ protected function getPreview(string $owner, int $fileId, string $filePath): arr
}

$preview = [
'link' => $this->getPreviewLink($info['path'], $info['is_dir'], $info['view']),
'link' => $this->getPreviewLink($info['path'], $info['is_dir'] ?? false, $info['view']),
'source' => '',
'mimeType' => 'application/octet-stream',
'isMimeTypeIcon' => true,
Expand Down Expand Up @@ -395,7 +395,7 @@ protected function getPreview(string $owner, int $fileId, string $filePath): arr
protected function getPreviewFromPath(int $fileId, string $filePath, array $info): array {
$mimeType = $info['is_dir'] ? 'dir' : $this->mimeTypeDetector->detectPath($filePath);
return [
'link' => $this->getPreviewLink($info['path'], $info['is_dir'], $info['view']),
'link' => $this->getPreviewLink($info['path'], $info['is_dir'] ?? false, $info['view']),
'source' => $this->getPreviewPathFromMimeType($mimeType),
'mimeType' => $mimeType,
'isMimeTypeIcon' => true,
Expand Down