mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-03 05:48:11 +08:00
@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user