Tag regex filters as "regex" to avoid the domain validation (otherwise regex lines could not get removed). Also ensure that deleting the first wildcard/regex does not hide the first exact blocking domain (this bug has been in since the very beginning of wildcard blocking)

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2018-06-30 14:42:52 +02:00
parent 4566db2a7c
commit e8b2cbe698
2 changed files with 7 additions and 6 deletions
+6 -5
View File
@@ -13,13 +13,14 @@ var listType = $("#list-type").html();
var fullName = listType === "white" ? "Whitelist" : "Blacklist";
function sub(index, entry, arg) {
var domain = $("#"+index);
var domain = $("#list #"+index);
var locallistType = listType;
domain.hide("highlight");
if(arg === "wild")
if(arg === "regex")
{
locallistType = "wild";
locallistType = "regex";
domain = $("#list-regex #"+index);
}
domain.hide("highlight");
$.ajax({
url: "scripts/pi-hole/php/sub.php",
method: "post",
@@ -104,7 +105,7 @@ function refresh(fade) {
"<span class=\"glyphicon glyphicon-trash\"></span></button></li>");
// Handle button
$("#list-regex #"+index+"").on("click", "button", function() {
sub(index, entry, "wild");
sub(index, entry, "regex");
});
});
}
+1 -1
View File
@@ -21,7 +21,7 @@ switch($type) {
case "black":
exec("sudo pihole -b -q -d ${_POST['domain']}");
break;
case "wild":
case "regex":
if(($list = file_get_contents($regexfile)) === FALSE)
{
$err = error_get_last()["message"];