mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
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:
@@ -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");
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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"];
|
||||
|
||||
Reference in New Issue
Block a user