Also use variable to disable reload in delteALL functions

Signed-off-by: yubiuser <ckoenig@posteo.de>
This commit is contained in:
yubiuser
2021-10-13 20:47:02 +02:00
parent b80c97f6d3
commit ab9454a582
2 changed files with 16 additions and 10 deletions

View File

@@ -519,14 +519,14 @@ if(isset($_POST["action"]))
if(isset($_POST["localdnsrecords"]) && $file->getFilename() === "custom.list")
{
ob_start();
$reload="false";
if($flushtables) {
// Defined in func.php included via auth.php
// will not restart Pi-hole
deleteAllCustomDNSEntries();
// passing reload="false" will not restart Pi-hole
deleteAllCustomDNSEntries($reload);
}
$num = 0;
$localdnsrecords = process_file(file_get_contents($file));
$reload="false";
foreach($localdnsrecords as $record) {
list($ip,$domain) = explode(" ",$record);
if(addCustomDNSEntry($ip, $domain, $reload, false))
@@ -543,15 +543,15 @@ if(isset($_POST["action"]))
if(isset($_POST["localcnamerecords"]) && $file->getFilename() === "05-pihole-custom-cname.conf")
{
ob_start();
$reload="false";
if($flushtables) {
// Defined in func.php included via auth.php
// will not restart Pi-hole
deleteAllCustomCNAMEEntries();
//passing reload="false" will not restart Pi-hole
deleteAllCustomCNAMEEntries($reload);
}
$num = 0;
$localcnamerecords = process_file(file_get_contents($file));
$reload="false";
foreach($localcnamerecords as $record) {
$line = str_replace("cname=","", $record);
$line = str_replace("\r","", $line);