From 67d9a638db5f1a0a0bc7fcf9b49e759c31604031 Mon Sep 17 00:00:00 2001 From: Zankaria Date: Wed, 23 Jul 2025 22:23:49 +0200 Subject: [PATCH] SearchService.php: fix flag filtering --- inc/Service/SearchService.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 [];