mirror of
https://github.com/pi-hole/web.git
synced 2026-04-24 10:50:23 +01:00
Merge branch 'devel' into TopItems
This commit is contained in:
@@ -334,6 +334,15 @@
|
||||
// Create empty array for gravity
|
||||
$gravity_domains = getGravity();
|
||||
|
||||
if(isset($_GET["from"]))
|
||||
{
|
||||
$from = new DateTime($_GET["from"]);
|
||||
}
|
||||
if(isset($_GET["until"]))
|
||||
{
|
||||
$until = new DateTime($_GET["until"]);
|
||||
}
|
||||
|
||||
setShowBlockedPermitted();
|
||||
|
||||
// Privacy mode?
|
||||
@@ -349,7 +358,26 @@
|
||||
}
|
||||
|
||||
foreach ($dns_queries as $query) {
|
||||
$time = date_create(substr($query, 0, 16));
|
||||
$time = new DateTime(substr($query, 0, 16));
|
||||
|
||||
// Check if we want to restrict the time where we want to show queries
|
||||
if(isset($from))
|
||||
{
|
||||
if($time <= $from)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if(isset($until))
|
||||
{
|
||||
if($time >= $until)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// print_r([$time->getTimestamp(),$_GET["from"],$_GET["until"]]);
|
||||
|
||||
$exploded = explode(" ", trim($query));
|
||||
$domain = $exploded[count($exploded)-3];
|
||||
$tmp = $exploded[count($exploded)-4];
|
||||
@@ -508,7 +536,7 @@
|
||||
$log->rewind();
|
||||
$lines = [];
|
||||
foreach ($log as $line) {
|
||||
$exploded = explode(" ", $line);
|
||||
$exploded = explode(" ", str_replace(" "," ",$line));
|
||||
if(count($exploded) == 8 || count($exploded) == 10) {
|
||||
// Structure of data is currently like:
|
||||
// Array
|
||||
|
||||
Reference in New Issue
Block a user