mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Call function setShowBlockedPermitted() only once + immediately return empty array when nothing to be shown (don't show blocked entries + privacy Mode enabled)
This commit is contained in:
@@ -266,14 +266,20 @@
|
||||
// Create empty array for gravity
|
||||
$gravity_domains = getGravity();
|
||||
|
||||
setShowBlockedPermitted();
|
||||
|
||||
if(!$showBlocked && $privacyMode)
|
||||
{
|
||||
// Nothing to do for us here
|
||||
return [];
|
||||
}
|
||||
|
||||
foreach ($dns_queries as $query) {
|
||||
$time = date_create(substr($query, 0, 16));
|
||||
$exploded = explode(" ", trim($query));
|
||||
$domain = $exploded[count($exploded)-3];
|
||||
$tmp = $exploded[count($exploded)-4];
|
||||
|
||||
setShowBlockedPermitted();
|
||||
|
||||
$status = isset($gravity_domains[$domain]) ? "Pi-holed" : "OK";
|
||||
if(($status === "Pi-holed" && $showBlocked) || ($status === "OK" && $showPermitted))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user