fix linecount

This commit is contained in:
Justin Theberge
2016-04-06 09:48:50 -04:00
parent 096bc06d65
commit 63539fa16a
+3 -6
View File
@@ -156,12 +156,9 @@
$file="/etc/pihole/gravity.list";
$linecount = 0;
$handle = fopen($file, "r");
if(gettype($handle) == "resource") {
while(!feof($handle)){
$line = fgets($handle);
$linecount++;
}
}
while ($chunk = fread($handle, 1024000)) {
$linecount += substr_count($chunk, "\n");
}
fclose($handle);
return $linecount;