mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 20:55:28 +00:00
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:
@@ -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)]);
|
||||
|
||||
Reference in New Issue
Block a user