Skip to content

Commit 82e4fe8

Browse files
committed
only allow certain sorts
1 parent 9b66822 commit 82e4fe8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Http/Controllers/CP/Assets/BrowserController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function folder(Request $request, $container, $path = '/')
9898
$sortByMethod = $order === 'desc' ? 'sortByDesc' : 'sortBy';
9999

100100
$folders = $folders->$sortByMethod(
101-
fn (AssetFolder $folder) => method_exists($folder, $sort) ? $folder->$sort() : $folder->basename()
101+
fn (AssetFolder $folder) => in_array($sort, ['basename', 'title', 'lastModified', 'size', 'count', 'path']) ? $folder->$sort() : $folder->basename()
102102
);
103103

104104
$folders = $folders->slice(($page - 1) * $perPage, $perPage);

0 commit comments

Comments
 (0)