aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/functions_rate.inc.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/functions_rate.inc.php b/include/functions_rate.inc.php
index 4cf6cc9ca..fdb21e242 100644
--- a/include/functions_rate.inc.php
+++ b/include/functions_rate.inc.php
@@ -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 )