forked from leftypol/leftypol
SearchService.php: fix flag filtering
This commit is contained in:
parent
f491fa0cf8
commit
67d9a638db
1 changed files with 3 additions and 1 deletions
|
|
@ -383,7 +383,9 @@ class SearchService {
|
||||||
|
|
||||||
$flags = [];
|
$flags = [];
|
||||||
if (!empty($filters->flag) && !empty($this->flag_map)) {
|
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)) {
|
if (empty($flags)) {
|
||||||
// The query doesn't match any flags so it will always fail anyway.
|
// The query doesn't match any flags so it will always fail anyway.
|
||||||
return [];
|
return [];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue