diff --git a/data.php b/data.php index c1c24440..0b8d2bbb 100644 --- a/data.php +++ b/data.php @@ -156,11 +156,12 @@ $file="/etc/pihole/gravity.list"; $linecount = 0; $handle = fopen($file, "r"); - while(!feof($handle)){ + if(gettype($handle) == "resource") { + while(!feof($handle)){ $line = fgets($handle); $linecount++; + } } - fclose($handle); return $linecount;