Skip to content

Commit

Permalink
rename $cidr to $subnetMask because it is a subnet mask in cidr notation
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Evers committed Oct 26, 2017
1 parent 9f8519b commit 9457972
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions setup/src/Magento/Setup/Validator/IpValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ private function filterIps(array $ips)
continue;
}

$cidr = 32;
$subnetMask = 32;
$ip = $range;
if (strpos($range, '/') !== false) {
list($ip, $cidr) = explode('/', $range);
list($ip, $subnetMask) = explode('/', $range);
}

$ipValidator = new \Zend\Validator\Ip();
Expand All @@ -86,7 +86,7 @@ private function filterIps(array $ips)

$ipv4Validator = new \Zend\Validator\Ip(['allowipv6' => false]);
$maxBits = $ipv4Validator->isValid($ip) ? 32 : 128;
if ($cidr < 0 || $cidr > $maxBits) {
if ($subnetMask < 0 || $subnetMask > $maxBits) {
$this->invalidIps[] = $range;
continue;
}
Expand Down

0 comments on commit 9457972

Please sign in to comment.