Merge pull request #812 from pi-hole/fix/settings_page_adlists_show_everything

Don't require adlists to start in "http"
This commit is contained in:
DL6ER
2018-08-08 21:32:18 +02:00
committed by GitHub

View File

@@ -137,12 +137,21 @@ function readAdlists()
{
while (($line = fgets($handle)) !== false)
{
if(substr($line, 0, 5) === "#http")
if(strlen($line) < 3)
{
// Commented list
array_push($list, [false,rtrim(substr($line, 1))]);
continue;
}
elseif(substr($line, 0, 4) === "http")
elseif($line[0] === "#")
{
// Comments start either with "##" or "# "
if($line[1] !== "#" &&
$line[1] !== " ")
{
// Commented list
array_push($list, [false,rtrim(substr($line, 1))]);
}
}
else
{
// Active list
array_push($list, [true,rtrim($line)]);