mirror of
https://github.com/pi-hole/web.git
synced 2026-04-24 10:50:23 +01:00
Support custom ports in the custom DNS server tab on the settings page
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -187,15 +187,28 @@ function readAdlists()
|
||||
{
|
||||
if(array_key_exists("custom".$i,$_POST))
|
||||
{
|
||||
$IP = $_POST["custom".$i."val"];
|
||||
if(validIP($IP))
|
||||
$exploded = explode("#", $_POST["custom".$i."val"], 2);
|
||||
$IP = $exploded[0];
|
||||
if(count($exploded) > 1)
|
||||
{
|
||||
array_push($DNSservers,$IP);
|
||||
$port = $exploded[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
$port = "53";
|
||||
}
|
||||
if(!validIP($IP))
|
||||
{
|
||||
$error .= "IP (".htmlspecialchars($IP).") is invalid!<br>";
|
||||
}
|
||||
elseif(!is_numeric($port))
|
||||
{
|
||||
$error .= "Port (".htmlspecialchars($port).") is invalid!<br>";
|
||||
}
|
||||
else
|
||||
{
|
||||
array_push($DNSservers,$IP."#".$port);
|
||||
}
|
||||
}
|
||||
}
|
||||
$DNSservercount = count($DNSservers);
|
||||
|
||||
Reference in New Issue
Block a user