diff --git a/inc/Service/SearchService.php b/inc/Service/SearchService.php index 8a1b3742..1bfcf0f9 100644 --- a/inc/Service/SearchService.php +++ b/inc/Service/SearchService.php @@ -383,7 +383,9 @@ class SearchService { $flags = []; if (!empty($filters->flag) && !empty($this->flag_map)) { - $flags = $this->matchStrings($this->flag_map, $filters->flag); + // A double array_values is necessary in order to re-index the array, otherwise it's left with random indexes. + $reverse_flags = \array_values(\array_values($this->flag_map)); + $flags = $this->matchStrings($reverse_flags, $filters->flag); if (empty($flags)) { // The query doesn't match any flags so it will always fail anyway. return [];