Fixed order or checks in IpValidator

Fixes #13198
This commit is contained in:
SilverFire - Dmitry Naumenko
2016-12-13 18:13:59 +02:00
parent 50b668eee8
commit a132ee9a08
5 changed files with 50 additions and 17 deletions

View File

@ -369,12 +369,12 @@ class IpValidator extends Validator
$cidr = static::IPV6_ADDRESS_LENGTH;
}
if (!$this->ipv6) {
return [$this->ipv6NotAllowed, []];
}
if (!$this->validateIPv6($ip)) {
return [$this->message, []];
}
if (!$this->ipv6) {
return [$this->ipv6NotAllowed, []];
}
if ($this->expandIPv6) {
$ip = $this->expandIPv6($ip);
@ -388,13 +388,12 @@ class IpValidator extends Validator
$isCidrDefault = true;
$cidr = static::IPV4_ADDRESS_LENGTH;
}
if (!$this->ipv4) {
return [$this->ipv4NotAllowed, []];
}
if (!$this->validateIPv4($ip)) {
return [$this->message, []];
}
if (!$this->ipv4) {
return [$this->ipv4NotAllowed, []];
}
}
if (!$this->isAllowed($ip, $cidr)) {