mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
avoid division by 0 warning when there are no rates in the database
git-svn-id: http://piwigo.org/svn/trunk@12412 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -150,8 +150,11 @@ SELECT element_id,
|
||||
$by_item[$row['element_id']] = $row;
|
||||
}
|
||||
|
||||
$all_rates_avg /= $all_rates_count;
|
||||
$item_ratecount_avg = $all_rates_count / count($by_item);
|
||||
if ($all_rates_count>0)
|
||||
{
|
||||
$all_rates_avg /= $all_rates_count;
|
||||
$item_ratecount_avg = $all_rates_count / count($by_item);
|
||||
}
|
||||
|
||||
$updates = array();
|
||||
foreach ($by_item as $id => $rate_summary )
|
||||
|
||||
Reference in New Issue
Block a user