[BUGFIX] Trim search value in live search 88/58188/2
authorGeorg Ringer <georg.ringer@gmail.com>
Wed, 5 Sep 2018 08:49:09 +0000 (10:49 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Wed, 5 Sep 2018 18:27:21 +0000 (20:27 +0200)
The query parameter of the live search should be trimmed.
The same behaviour is already used in the regular search in the list module which is
available in the live search by clicking on the button "show all".

Resolves: #86149
Releases: master, 8.7
Change-Id: I3ec2ac03f67fa8c0daaa11aaf3e4351d05949b83
Reviewed-on: https://review.typo3.org/58188
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Josef Glatz <josef.glatz@typo3.org>
Tested-by: Josef Glatz <josef.glatz@typo3.org>
Reviewed-by: Willi Wehmeier <wwwehmeier@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>

index 4623a4d..b475f50 100644 (file)
@@ -39,7 +39,7 @@ class LiveSearchController
     public function liveSearchAction(ServerRequestInterface $request): ResponseInterface
-        $queryString = $request->getQueryParams()['q'];
+        $queryString = trim($request->getQueryParams()['q']);
         $liveSearch = GeneralUtility::makeInstance(LiveSearch::class);
         $queryParser = GeneralUtility::makeInstance(QueryParser::class);