[BUGFIX] Trim search value in live search 94/58194/3
authorGeorg Ringer <georg.ringer@gmail.com>
Wed, 5 Sep 2018 08:49:09 +0000 (10:49 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Sat, 8 Sep 2018 08:40:26 +0000 (10:40 +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/58194
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Classes/Controller/LiveSearchController.php

index ba20598..16ba55d 100644 (file)
@@ -39,7 +39,7 @@ class LiveSearchController
      */
     public function liveSearchAction(ServerRequestInterface $request, ResponseInterface $response)
     {
-        $queryString = $request->getQueryParams()['q'];
+        $queryString = trim($request->getQueryParams()['q']);
         $liveSearch = GeneralUtility::makeInstance(LiveSearch::class);
         $queryParser = GeneralUtility::makeInstance(QueryParser::class);