Don't require adlists to start in "http". This also displays lists that start in e.g., "ftp://" or "file://" or without a protocol.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2018-08-08 12:06:59 +02:00
parent 4d42735676
commit 8b1313b864

View File

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