mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
fixes #2256 make search on deleted albums more robust
* old links search.php?cat_id=123 will now check the album id * existing search including a filter on an album will check the album is still available
This commit is contained in:
@@ -380,10 +380,15 @@ SELECT
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO we take the list of cat_ids "as is", we should check they still
|
||||
// exist and are browseable to the user
|
||||
$cat_ids = $search['fields']['cat']['words'];
|
||||
}
|
||||
|
||||
$query = '
|
||||
// in case the album would no longer exists, we consider the filter on album no longer active
|
||||
if (!empty($cat_ids))
|
||||
{
|
||||
$query = '
|
||||
SELECT
|
||||
DISTINCT(id)
|
||||
FROM '.IMAGES_TABLE.' AS i
|
||||
@@ -391,7 +396,8 @@ SELECT
|
||||
WHERE category_id IN ('.implode(',', $cat_ids).')
|
||||
'.$forbidden.'
|
||||
;';
|
||||
$image_ids_for_filter['cat'] = query2array($query, null, 'id');
|
||||
$image_ids_for_filter['cat'] = query2array($query, null, 'id');
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user