diff --git a/scripts/pi-hole/js/list.js b/scripts/pi-hole/js/list.js index 3feb24fc..a5bcafd9 100644 --- a/scripts/pi-hole/js/list.js +++ b/scripts/pi-hole/js/list.js @@ -47,10 +47,7 @@ function refresh(fade) { var listw = $("#list-regex"); if(fade) { list.fadeOut(100); - if(listw) - { - listw.fadeOut(100); - } + listw.fadeOut(100); } $.ajax({ url: "scripts/pi-hole/php/get.php", @@ -58,10 +55,7 @@ function refresh(fade) { data: {"list":listType}, success: function(response) { list.html(""); - if(listw) - { - listw.html(""); - } + listw.html(""); if((listType === "black" && response.blacklist.length === 0 && @@ -105,10 +99,7 @@ function refresh(fade) { }); } list.fadeIn(100); - if(listw) - { - listw.fadeIn(100); - } + listw.fadeIn(100); }, error: function(jqXHR, exception) { $("#alFailure").show(); diff --git a/scripts/pi-hole/php/func.php b/scripts/pi-hole/php/func.php index 7c1d3d65..bc353218 100644 --- a/scripts/pi-hole/php/func.php +++ b/scripts/pi-hole/php/func.php @@ -45,21 +45,4 @@ if(!function_exists('hash_equals')) { } } -function add_regex($regex, $mode=FILE_APPEND, $append="\n") -{ - global $regexfile; - if(file_put_contents($regexfile, $regex.$append, $mode) === FALSE) - { - $err = error_get_last()["message"]; - echo "Unable to add regex \"".htmlspecialchars($regex)."\" to ${regexfile}
Error message: $err"; - } - else - { - // Send SIGHUP to pihole-FTL using a frontend command - // to force reloading of the regex domains - // This will also wipe the resolver's cache - echo exec("sudo pihole restartdns reload"); - } -} - ?>