/* First check if we want a specific gallery or a list of images */
if (!empty($params['gallery_id'])) {
$sql = 'SELECT ' . $this->_getImageFields() . ' FROM ansel_images WHERE gallery_id = ' . $params['gallery_id'] . ' ORDER BY image_sort';
- } elseif (is_array($params['ids']) && count($params['ids']) > 0) {
+ } elseif (!empty($params['ids']) && is_array($params['ids']) && count($params['ids']) > 0) {
$sql = 'SELECT ' . $this->_getImageFields() . ' FROM ansel_images WHERE image_id IN (';
$i = 1;
$cnt = count($params['ids']);
return $iresults;
}
- $images = array_values($GLOBALS['ansel_storage']->getImages($iresults['images']));
+ $images = count($iresults['images']) ? array_values($GLOBALS['ansel_storage']->getImages($iresults['images'])) : array();
if (($conf['comments']['allow'] == 'all' || ($conf['comments']['allow'] == 'authenticated' && Horde_Auth::getAuth())) &&
$registry->hasMethod('forums/numMessagesBatch')) {