Proxy Portrange beschraenkt Port darf nicht 444 222 81 oder 53 sein und muss zwischen 1 und 65535

git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@558 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
maniacikarus
2007-05-13 11:53:36 +00:00
parent a99274b3b6
commit d30ea45136
2 changed files with 16 additions and 1 deletions

View File

@@ -203,6 +203,21 @@ sub validport
return 0;
}
sub validproxyport
{
$_ = $_[0];
if (!/^\d+$/) {
return 0; }
if (/^0./) {
return 0; }
if ($_ == 53 || $_ == 222 || $_ == 444 || $_ == 81 ) {
return 0; }
elsif ($_ >= 1 && $_ <= 65535) {
return 1; }
return 0;
}
sub validmac
{
my $checkmac = $_[0];

View File

@@ -312,7 +312,7 @@ if (($proxysettings{'ACTION'} eq $Lang::tr{'save'}) || ($proxysettings{'ACTION'}
$errormessage = $Lang::tr{'invalid input'};
goto ERROR;
}
if (!(&General::validport($proxysettings{'PROXY_PORT'})))
if (!(&General::validproxyport($proxysettings{'PROXY_PORT'})))
{
$errormessage = $Lang::tr{'advproxy errmsg invalid proxy port'};
goto ERROR;