Fix error when filtering search tags
Arrays are key-value maps. We should reindex the array after a filter since we are using the key and count to do array access in filterTags. An example would be searching for "foo, bar", after the array filter, our array is actually (0 -> foo, 2 -> bar) which will cause an error when trying to access $searchtags[1].
This commit is contained in:
parent
9f400b0dad
commit
20f89623c0
1 changed files with 1 additions and 1 deletions
|
@ -322,7 +322,7 @@ public static function tagsStrToArray($tags, $casesensitive)
|
|||
$tagsOut = $casesensitive ? $tags : mb_convert_case($tags, MB_CASE_LOWER, 'UTF-8');
|
||||
$tagsOut = str_replace(',', ' ', $tagsOut);
|
||||
|
||||
return array_filter(explode(' ', trim($tagsOut)), 'strlen');
|
||||
return array_values(array_filter(explode(' ', trim($tagsOut)), 'strlen'));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue