feat(firewall): add safeguarded rule creation
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -95,6 +95,7 @@ class IpUtils
|
||||
if ($netmask < 0 || $netmask > 32) {
|
||||
return self::setCacheResult($cacheKey, false);
|
||||
}
|
||||
$netmask = (int)$netmask;
|
||||
} else {
|
||||
$address = $ip;
|
||||
$netmask = 32;
|
||||
@@ -149,6 +150,7 @@ class IpUtils
|
||||
if ($netmask < 1 || $netmask > 128) {
|
||||
return self::setCacheResult($cacheKey, false);
|
||||
}
|
||||
$netmask = (int)$netmask;
|
||||
} else {
|
||||
if (!filter_var($ip, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV6)) {
|
||||
return self::setCacheResult($cacheKey, false);
|
||||
|
||||
Reference in New Issue
Block a user