Skip to content
This repository has been archived by the owner on Feb 7, 2025. It is now read-only.

1.6 #5834

Open
wants to merge 2 commits into
base: 1.6
Choose a base branch
from
Open

1.6 #5834

Changes from all commits
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
5 changes: 3 additions & 2 deletions src/Http/Controllers/VoyagerMediaController.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ public function files(Request $request)
'last_modified' => '',
];
} else {
if (empty(pathinfo($item['path'], PATHINFO_FILENAME)) && !config('voyager.hidden_files')) {
$pathinfo = pathinfo($item['path']);
if (empty($pathinfo['filename']) && !config('voyager.hidden_files')) {
continue;
}
// Its a thumbnail and thumbnails should be hidden
Expand All @@ -86,7 +87,7 @@ public function files(Request $request)
}
$files[] = [
'name' => $item['basename'] ?? basename($item['path']),
'filename' => $item['filename'] ?? basename($item['path'], '.'.pathinfo($item['path'])['extension']),
'filename' => $item['filename'] ?? basename($item['path'], isset($pathinfo['extension']) ? '.'.$pathinfo['extension'] : null),
'type' => $item['mimetype'] ?? $mime,
'path' => Storage::disk($this->filesystem)->url($item['path']),
'relative_path' => $item['path'],
Expand Down
Loading