Closed bhsmither closed 1 month ago
Similar to #3506, code needs to be reviewed in statistics.index.inc.php where the result from DB->query() could result in a zero value - however improbable that could be.
DB->query()
Near lines 177-178 could be combined to:
$result['percent'] = (float)$divider[0]['totalProducts'] ? number_format(100*($result['quan']/$divider[0]['totalProducts']),2) : 0;
Near lines 212-214 could be combined to:
$result['percent'] = (float)$divider[0]['totalHits'] ? number_format(100*($result['popularity']/$divider[0]['totalHits']),2) : 0; // not used // $max_percent = ($result['percent']>$max_percent) ? $result['percent'] : $max_percent;
Near lines 246-248 could be combined to:
$result['percent'] = (float)$divider[0]['totalHits'] ? number_format(100*($result['hits']/$divider[0]['totalHits']),2) : 0; // not used // $max_percent = ($result['percent']>$max_percent) ? $result['percent'] : $max_percent;
Fantastic. Thanks.
Similar to #3506, code needs to be reviewed in statistics.index.inc.php where the result from
DB->query()
could result in a zero value - however improbable that could be.Near lines 177-178 could be combined to:
Near lines 212-214 could be combined to:
Near lines 246-248 could be combined to: