From 97023278b33e9da17618892fb91ae6f8c94d94e1 Mon Sep 17 00:00:00 2001 From: Mark Drobnak Date: Tue, 31 Jul 2018 21:12:41 -0400 Subject: [PATCH] Ignore commented lines in list files Signed-off-by: Mark Drobnak --- scripts/pi-hole/php/get.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/pi-hole/php/get.php b/scripts/pi-hole/php/get.php index a05b4eea..63e69ec9 100644 --- a/scripts/pi-hole/php/get.php +++ b/scripts/pi-hole/php/get.php @@ -38,9 +38,9 @@ function getListContent($listname) { $rawList = file_get_contents(checkfile($basedir.$listname)); $list = explode("\n", $rawList); - // Get rid of empty lines + // Get rid of empty lines and comments for($i = sizeof($list)-1; $i >= 0; $i--) { - if(strlen($list[$i]) < 1) + if(strlen($list[$i]) < 1 || $list[$i][0] === '#') unset($list[$i]); }