diff --git a/scripts/pi-hole/php/add.php b/scripts/pi-hole/php/add.php index d3ab2b4b..762ea2cf 100644 --- a/scripts/pi-hole/php/add.php +++ b/scripts/pi-hole/php/add.php @@ -10,12 +10,18 @@ require_once('auth.php'); $type = $_POST['list']; -// Perform all of the verification for list editing +// Perform all of the authentication for list editing // when NOT invoked and authenticated from API if (empty($api)) { list_verify($type); } +// Don't check if the added item is a valid domain for regex expressions. Regex +// filters are validated by FTL on import and skipped if invalid +if($type !== "regex") { + check_domain(); +} + switch($type) { case "white": if(!isset($_POST["auditlog"])) diff --git a/scripts/pi-hole/php/auth.php b/scripts/pi-hole/php/auth.php index 5d832a86..69fe6b28 100644 --- a/scripts/pi-hole/php/auth.php +++ b/scripts/pi-hole/php/auth.php @@ -142,14 +142,5 @@ function list_verify($type) { { log_and_die("Not allowed!"); } - - // Don't check if the added item is a - // valid domain for regex expressions - // Regex filters are validated by FTL - // on import and skipped if invalid - if($_POST['list'] !== "regex") - { - check_domain(); - } } ?> diff --git a/scripts/pi-hole/php/sub.php b/scripts/pi-hole/php/sub.php index 2edf8cf7..1c9bc8fe 100644 --- a/scripts/pi-hole/php/sub.php +++ b/scripts/pi-hole/php/sub.php @@ -10,12 +10,18 @@ require_once('auth.php'); $type = $_POST['list']; -// Perform all of the verification for list editing +// Perform all of the authentication for list editing // when NOT invoked and authenticated from API if (empty($api)) { list_verify($type); } +// Don't check if the added item is a valid domain for regex expressions. Regex +// filters are validated by FTL on import and skipped if invalid +if($type !== "regex") { + check_domain(); +} + switch($type) { case "white": exec("sudo pihole -w -q -d ${_POST['domain']}");