diff --git a/src/Control/SimpleSuggestions.php b/src/Control/SimpleSuggestions.php index 35282b03..b0d647f6 100644 --- a/src/Control/SimpleSuggestions.php +++ b/src/Control/SimpleSuggestions.php @@ -2,7 +2,6 @@ namespace ipl\Web\Control; -use Generator; use ipl\Html\Attributes; use ipl\Html\BaseHtmlElement; use ipl\Html\FormattedString; @@ -163,7 +162,7 @@ public function forRequest(ServerRequestInterface $request): self return $this; } - $search = $requestData['term']['search']; + $search = str_replace(['"', "'"], '', $requestData['term']['search']); $label = $requestData['term']['label']; $exclude = $requestData['exclude']; @@ -171,7 +170,7 @@ public function forRequest(ServerRequestInterface $request): self $this->setData($this->fetchSuggestions($label, $exclude)); - if ($search) { + if (! empty($search)) { $this->setDefault($search); }