Skip to content

Commit 0de579e

Browse files
botwebirnnr
authored andcommitted
[BUGFIX] Prevent LastSearches from adding empty queries
Change-Id: Ibaafe8ce0828b32a3bfc276a4cf0e2694957092b
1 parent b5b1e75 commit 0de579e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Classes/ResultsetModifier/LastSearches.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ public function modifyResultSet(Tx_Solr_PiResults_ResultsCommand $resultCommand,
4747
$this->configuration = $resultCommand->getParentPlugin()->getConfiguration();
4848
$keywords = $resultCommand->getParentPlugin()->getSearch()->getQuery()->getKeywordsCleaned();
4949

50+
$keywords = trim($keywords);
51+
if(empty($keywords)) {
52+
return $resultSet;
53+
}
54+
5055
switch ($this->configuration['search.']['lastSearches.']['mode']) {
5156
case 'user':
5257
$this->storeKeywordsToSession($keywords);

0 commit comments

Comments
 (0)