[search] avoid errors when a filter returns no item

This commit is contained in:
plegall
2023-10-28 18:35:20 +02:00
parent c94313fdc3
commit 13ea43e2ef
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -159,7 +159,7 @@ function get_sql_search_clause($search)
// ((field1 LIKE '%word1%' OR field2 LIKE '%word1%')
// AND (field1 LIKE '%word2%' OR field2 LIKE '%word2%'))
$word_clauses = array();
$cat_ids_by_word = array();
$cat_ids_by_word = $tag_ids_by_word = array();
foreach ($search['fields']['allwords']['words'] as $word)
{
$field_clauses = array();
+1 -1
View File
@@ -367,11 +367,11 @@ SELECT
ORDER BY counter DESC
;';
$added_by = query2array($query);
$user_ids = array();
if (count($added_by) > 0)
{
// now let's find the usernames of added_by users
$user_ids = array();
foreach ($added_by as $i)
{
$user_ids[] = $i['added_by_id'];