Add ability for user to include comment when adding a blocklist

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
Adam Warner
2019-10-14 22:59:05 +01:00
parent 34de877ccf
commit 8311a0aefc
3 changed files with 13 additions and 5 deletions

View File

@@ -707,9 +707,10 @@ function readAdlists()
if(strlen($_POST["newuserlists"]) > 1)
{
$domains = array_filter(preg_split('/\r\n|[\r\n]/', $_POST["newuserlists"]));
$comment = "'".$_POST["newusercomment"]."'";
foreach($domains as $domain)
{
exec("sudo pihole -a adlist add ".escapeshellcmd($domain));
exec("sudo pihole -a adlist add ".escapeshellcmd($domain)." ".escapeshellcmd($comment));
}
}