cidr notation can only be 1 through 32
This commit is contained in:
Pascal
2019-10-28 16:27:54 +01:00
parent 686c2ae534
commit 2ed0cad27b

View File

@@ -123,6 +123,9 @@ class Validate
$org_ip = $ip;
$ip_cidr = explode("/", $ip);
if (count($ip_cidr) === 2) {
if(in_array((int)$ip_cidr[1], array_values(range(1, 32)), TRUE) === false) {
\Froxlor\UI\Response::standard_error($lng, $ip, $throw_exception);
}
if (self::is_ipv6($ip)) {
//MySQL does not handle CIDR of IPv6 addresses, return error
if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === false) {