issue #1869 search filters, optimize filter data loading and match permissions

* only load list of authors if this filter is active (same for tags, added_by...)
* if the search_rules include album 123 but this album is not available to current user, remove it from search_rules before sending it to template
This commit is contained in:
plegall 2023-06-22 12:00:43 +02:00
parent 3d6c533e98
commit c01ec38bc4
3 changed files with 157 additions and 142 deletions

View file

@ -30,9 +30,14 @@ SELECT rules
FROM '.SEARCH_TABLE.'
WHERE id = '.$search_id.'
;';
list($serialized_rules) = pwg_db_fetch_row(pwg_query($query));
$rules_list = query2array($query);
return unserialize($serialized_rules);
if (count($rules_list) == 0)
{
bad_request('this search identifier does not exist');
}
return unserialize($rules_list[0]['rules']);
}
/**