From 5b56a6871fcb63cf8bfe15852ea0d0e5db7d6132 Mon Sep 17 00:00:00 2001 From: RD WebDesign Date: Wed, 13 Jul 2022 19:12:41 -0300 Subject: [PATCH] Removing the text `dnsmasq[nnnn]` from the log. Signed-off-by: RD WebDesign --- scripts/pi-hole/php/tailLog.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/pi-hole/php/tailLog.php b/scripts/pi-hole/php/tailLog.php index cdd2b301..a7d12ef3 100644 --- a/scripts/pi-hole/php/tailLog.php +++ b/scripts/pi-hole/php/tailLog.php @@ -10,12 +10,14 @@ require "password.php"; if(!$auth) die("Not authorized"); function formatLine($line){ + $txt = preg_replace("/ dnsmasq\[[0-9]*\]/", "", htmlspecialchars($line)); + if (strpos($line, "blacklisted") || strpos($line, "gravity blocked")) { - $txt = ''.htmlspecialchars($line).''; + $txt = ''.$txt.''; } elseif (strpos($line, "query[A") || strpos($line, "query[DHCP")) { - $txt = ''.htmlspecialchars($line).''; + $txt = ''.$txt.''; } else { - $txt = ''.htmlspecialchars($line).''; + $txt = ''.$txt.''; } return $txt; }