Fix search form ending in dash error

On the search form if a user's search ends in a dash it will cause a server error.

This change fixes this problem by trimming dashes and spaces from the end of the search term.
This commit is contained in:
3Dgoo 2022-03-28 06:59:25 +10:30 committed by GitHub
parent 6f24df9299
commit 298ff4a9d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -146,7 +146,7 @@ class SearchForm extends Form
}
}
$keywords = $request->requestVar('Search');
$keywords = rtrim($request->requestVar('Search'), '- ');
$andProcessor = function ($matches) {
return ' +' . $matches[2] . ' +' . $matches[4] . ' ';