From 5ebc8ac23ab2d90d1ff0d80cef21a78a142e9ffe Mon Sep 17 00:00:00 2001 From: DL6ER Date: Wed, 21 Dec 2016 14:35:49 +0100 Subject: [PATCH] Simplify function gravityCount() --- scripts/pi-hole/php/data.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/scripts/pi-hole/php/data.php b/scripts/pi-hole/php/data.php index 9ce6302f..7d10545f 100644 --- a/scripts/pi-hole/php/data.php +++ b/scripts/pi-hole/php/data.php @@ -264,15 +264,8 @@ function gravityCount() { global $blackListFile; $preEventHorizon = exec("grep -c ^ /etc/pihole/list.preEventHorizon"); - if(file_exists($blackListFile)) - { - $blacklist = exec("grep -c ^ /etc/pihole/blacklist.txt"); - return ($preEventHorizon + $blacklist); - } - else - { - return ($preEventHorizon); - } + $blacklist = exec("grep -c ^ $blackListFile"); + return ($preEventHorizon + $blacklist); } function getDnsQueries(\SplFileObject $log) {