mirror of
https://github.com/pi-hole/web.git
synced 2026-04-24 18:59:48 +01:00
Skip DNS server processing if the requested type is not available for this server (#1970)
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -209,10 +209,19 @@ function addStaticDHCPLease($mac, $ip, $hostname) {
|
||||
{
|
||||
foreach(["v4_1", "v4_2", "v6_1", "v6_2"] as $type)
|
||||
{
|
||||
if(@array_key_exists("DNSserver".str_replace(".","_",$value[$type]),$_POST))
|
||||
{
|
||||
array_push($DNSservers,$value[$type]);
|
||||
}
|
||||
// Skip if this IP type does not
|
||||
// exist (e.g. IPv4-only or only
|
||||
// one IPv6 address upstream
|
||||
// server)
|
||||
if(!array_key_exists($type, $value))
|
||||
continue;
|
||||
|
||||
// If server exists and is set
|
||||
// (POST), we add it to the
|
||||
// array of DNS servers
|
||||
$server = str_replace(".", "_", $value[$type]);
|
||||
if(array_key_exists("DNSserver".$server, $_POST))
|
||||
array_push($DNSservers, $value[$type]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user