mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 03:07:43 +02:00
dns.cgi: Check for empty server address.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
This commit is contained in:
@@ -95,8 +95,13 @@ if (($cgiparams{'SERVERS'} eq $Lang::tr{'save'}) || ($cgiparams{'SERVERS'} eq $L
|
||||
# Read-in generic settings.
|
||||
&General::readhash("$settings_file", \%settings);
|
||||
|
||||
# Check if an IP-address has been given.
|
||||
if ($cgiparams{"NAMESERVER"} eq "") {
|
||||
$errormessage = "$Lang::tr{'dns no address given'}";
|
||||
}
|
||||
|
||||
# Check if the given DNS server is valid.
|
||||
if(!&General::validip($cgiparams{"NAMESERVER"})) {
|
||||
elsif(!&General::validip($cgiparams{"NAMESERVER"})) {
|
||||
$errormessage = "$Lang::tr{'invalid ip'}: $cgiparams{'NAMESERVER'}";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user