Changeset 12413


Ignore:
Timestamp:
Oct 11, 2011, 10:14:11 PM (9 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
  • branches/2.3/include/functions_rate.inc.php

    r11893 r12413  
    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.