Skip to content
Merged
Show file tree
Hide file tree
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
Prev Previous commit
cast to bool
  • Loading branch information
kokspflanze authored and Backportbot committed Nov 26, 2019
commit 791f961f12c1c20df5c83aeecedba0e0f86b38b6
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'] ?? false, $info['view']),
'link' => $this->getPreviewLink($info['path'], $info['is_dir'], $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'] ?? false, $info['view']),
'link' => $this->getPreviewLink($info['path'], $info['is_dir'], $info['view']),
'source' => $this->getPreviewPathFromMimeType($mimeType),
'mimeType' => $mimeType,
'isMimeTypeIcon' => true,
Expand Down
4 changes: 2 additions & 2 deletions lib/ViewInfoCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ protected function findInfoByPath($user, $path) {
$this->cachePath[$user][$path] = [
'path' => $path,
'exists' => $exists,
'is_dir' => $exists ? $this->view->is_dir($path) : false,
'is_dir' => $exists ? (bool)$this->view->is_dir($path) : false,
'view' => '',
];

Expand Down Expand Up @@ -128,7 +128,7 @@ protected function findInfoById($user, $fileId, $filePath) {
$cache = [
'path' => substr($path, strlen('/files')),
'exists' => true,
'is_dir' => $this->view->is_dir($path),
'is_dir' => (bool)$this->view->is_dir($path),
'view' => 'trashbin',
];
} catch (NotFoundException $e) {
Expand Down