Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update add.php #1360

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions scripts/pi-hole/php/add.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,22 @@
switch($list) {
case "white":
$domains = array_map('strtolower', $domains);
remove_from_table($db, "domainlist", $domains, $returnnum=false, $type=1);
This conversation was marked as resolved.
Show resolved Hide resolved
echo add_to_table($db, "domainlist", $domains, $comment, false, false, ListType::whitelist);
break;

case "black":
$domains = array_map('strtolower', $domains);
remove_from_table($db, "domainlist", $domains, $returnnum=false, $type=0);
echo add_to_table($db, "domainlist", $domains, $comment, false, false, ListType::blacklist);
break;

case "none":
$domains = array_map('strtolower', $domains);
echo remove_from_table($db, "domainlist", $domains, $returnnum=false, $type=0) . " [whitelist]\r\n";
echo remove_from_table($db, "domainlist", $domains, $returnnum=false, $type=1) . " [blacklist]";
This conversation was marked as resolved.
Show resolved Hide resolved
break;

case "white_regex":
echo add_to_table($db, "domainlist", $domains, $comment, false, false, ListType::regex_whitelist);
break;
Expand Down