mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 20:55:28 +00:00
Ignore commented lines in list files
Signed-off-by: Mark Drobnak <mark.drobnak@gmail.com>
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user