Fix 500 when searching for empty term (#1340)

This commit is contained in:
Boy132 2025-05-05 23:31:36 +02:00 committed by GitHub
parent 79691ba663
commit c8230771ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -515,8 +515,9 @@ class ListFiles extends ListRecords
->form([
TextInput::make('searchTerm')
->placeholder('Enter a search term, e.g. *.txt')
->required()
->regex('/^[^*]*\*?[^*]*$/')
->minLength(3),
->minValue(3),
])
->action(fn ($data) => redirect(SearchFiles::getUrl([
'searchTerm' => $data['searchTerm'],