Ignore commented lines in list files

Signed-off-by: Mark Drobnak <mark.drobnak@gmail.com>
This commit is contained in:
Mark Drobnak
2018-07-31 21:12:41 -04:00
committed by GitHub
parent 16ee8908ba
commit 97023278b3

View File

@@ -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]);
}