diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-03-20 23:40:42 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-03-21 13:36:50 +0100 |
commit | 1773a27fe29f07bc0ef4f24088f9c1dc5a470b52 (patch) | |
tree | 9328c556578755de31b0e97f0a16724ed98e6a07 /controller | |
parent | 4e500dd1a91008c54e8560a6e35f38530edb52bb (diff) |
search in lower case and ignore weird whitespace
Diffstat (limited to 'controller')
-rw-r--r-- | controller/itemcontroller.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/controller/itemcontroller.php b/controller/itemcontroller.php index 072ab93a7..cced48077 100644 --- a/controller/itemcontroller.php +++ b/controller/itemcontroller.php @@ -84,8 +84,9 @@ class ItemController extends Controller { $params = []; // split search parameter on url space - $search = urldecode($search); - if (trim($search) === '') { + $search = trim(urldecode($search)); + $search = preg_replace('/\s+/', ' ', $search); // remove multiple whitespace + if ($search === '') { $search = []; } else { $search = explode(' ', $search); |