make it more readable

This commit is contained in:
Pascal
2019-10-28 13:15:48 +01:00
parent ffefe85fb4
commit c97cdb1c0e

View File

@@ -108,7 +108,7 @@ class Validate
$ip_cidr = explode("/", $ip);
if (count($ip_cidr) == 2) {
$ip = $ip_cidr[0];
if(in_array((int)strlen((string)$ip_cidr[1]),array(1,2))) {
if (strlen($ip_cidr[1]) <= 2) {
$ip_cidr[1] = self::cidr2NetmaskAddr($org_ip);
}
$cidr = "/" . $ip_cidr[1];