SearchService.php: fix flag filtering

This commit is contained in:
Zankaria 2025-07-23 22:23:49 +02:00
parent f491fa0cf8
commit 67d9a638db

View file

@ -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 [];