Changeset 12412


Ignore:
Timestamp:
Oct 11, 2011, 10:09:08 PM (13 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.