Skip to content

Commit

Permalink
refactor: if $len is uneven we run into an error
Browse files Browse the repository at this point in the history
  • Loading branch information
sitepark-veltrup committed Mar 21, 2024
1 parent 6bee895 commit 0ebb699
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Service/Search/SolrSuggest.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private function parseSuggestion(
$len = count($facets);

$suggestions = [];
for ($i = 0; $i < $len; $i += 2) {
for ($i = 0; $i < $len - 1; $i += 2) {
$term = $facets[$i];
$hits = (int)$facets[$i + 1];
$suggestions[] = new Suggestion($term, $hits);
Expand Down

0 comments on commit 0ebb699

Please sign in to comment.