framework/validators/IpValidator.php
private function isAllowed($ip, $cidr)
    {
        if (empty($this->ranges)) {
            return true;
        }

        foreach ($this->ranges as $string) {
            list($isNegated, $range) = $this->parseNegatedRange($string);
            if ($this->inRange($ip, $cidr, $range)) {
                return !$isNegated;
            }
        }

        return false;
    }
private function isAllowed($ip, $cidr)
    {
        if (empty($this->ranges)) {
            return true;
        }

        foreach ($this->ranges as $string) {
            list($isNegated, $range) = $this->parseNegatedRange($string);
            if ($this->inRange($ip, $cidr, $range)) {
                return !$isNegated;
            }
        }

        return false;
    }
private function isAllowed ( $ ip , $ cidr ) { if ( empty ( $ this -> ranges ) ) { return true ; } foreach ( $ this -> ranges as $ string ) { list ( $ isNegated , $ range ) = $ this -> parseNegatedRange ( $ string ) ; if ( $ this -> inRange ( $ ip , $ cidr , $ range ) ) { return ! $ isNegated ; } } return false ; }
The method checks whether the IP address with specified CIDR is allowed according to the [[ranges]] list.

@param string $ip
@param int $cidr
@return bool
@see ranges
The method checks whether the IP address with specified CIDR is allowed according to the [[ ranges ]] list .