Changeset 12412


Ignore:
Timestamp:
10/11/11 22:09:08 (8 years ago)
Author:
rvelices
Message:

avoid division by 0 warning when there are no rates in the database

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_rate.inc.php

    r11893 r12412  
    151151  } 
    152152 
    153   $all_rates_avg /= $all_rates_count; 
    154   $item_ratecount_avg = $all_rates_count / count($by_item); 
     153  if ($all_rates_count>0) 
     154  { 
     155    $all_rates_avg /= $all_rates_count; 
     156    $item_ratecount_avg = $all_rates_count / count($by_item); 
     157  } 
    155158 
    156159  $updates = array(); 
Note: See TracChangeset for help on using the changeset viewer.