mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Fix divide-by-zero error as mentioned in #55
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
|
||||
$ads_blocked_today = count(getBlockedQueries($log));
|
||||
|
||||
$ads_percentage_today = $ads_blocked_today / $dns_queries_today * 100;
|
||||
$ads_percentage_today = $dns_queries_today > 0 ? ($ads_blocked_today / $dns_queries_today * 100) : 0;
|
||||
|
||||
return array(
|
||||
'domains_being_blocked' => $domains_being_blocked,
|
||||
|
||||
Reference in New Issue
Block a user