Update index.php

Avoiding calling empty() on a function allows this to work under PHP5. Making the check for blocklist generation in this way instead is compatible with both PHP5 and PHP7.

Signed-off-by: Rob Gill <rrobgill@protonmail.com>
pull/2176/head
Rob Gill 6 years ago committed by GitHub
parent b1ab7f46e0
commit 31951dae4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -102,7 +102,8 @@ if ($serverName === "pi.hole") {
$bpAskAdmin = !empty($svEmail) ? '<a href="mailto:'.$svEmail.'?subject=Site Blocked: '.$serverName.'"></a>' : "<span/>";
// Determine if at least one block list has been generated
if (empty(glob("/etc/pihole/list.0.*.domains")))
$blocklistglob = glob("/etc/pihole/list.0.*.domains");
if ($blocklistglob = "")
die("[ERROR] There are no domain lists generated lists within <code>/etc/pihole/</code>! Please update gravity by running <code>pihole -g</code>, or repair Pi-hole using <code>pihole -r</code>.");
// Set location of adlists file

Loading…
Cancel
Save