private function isAllowed($ip) {
        // Look for a wildcard
        if (in_array('*', $this->params['allow'])) {
            // There is a wildcard in the list, all IP's are allowed
            return true;
        }

        // Remove IP's which is not of the same type as $ip before matching
        if ($this->isIPv6($ip)) {
            $list = array_filter($this->params['allow'], [$this, 'isIPv6']);
        } else {
            $list = array_filter($this->params['allow'], [$this, 'isIPv4']);
        }

        foreach ($list as $range) {
            if ((strpos($range, '/') !== false && $this->cidrMatch($ip, $range)) || $ip === $range) {
                return true;
            }
        }

        return false;
    }
private function isAllowed($ip) {
        // Look for a wildcard
        if (in_array('*', $this->params['allow'])) {
            // There is a wildcard in the list, all IP's are allowed
            return true;
        }

        // Remove IP's which is not of the same type as $ip before matching
        if ($this->isIPv6($ip)) {
            $list = array_filter($this->params['allow'], [$this, 'isIPv6']);
        } else {
            $list = array_filter($this->params['allow'], [$this, 'isIPv4']);
        }

        foreach ($list as $range) {
            if ((strpos($range, '/') !== false && $this->cidrMatch($ip, $range)) || $ip === $range) {
                return true;
            }
        }

        return false;
    }
private function isAllowed ( $ ip ) { // Look for a wildcard if ( in_array ( '*' , $ this -> params [ 'allow' ] ) ) { // There is a wildcard in the list, all IP's are allowed return true ; } // Remove IP's which is not of the same type as $ip before matching if ( $ this -> isIPv6 ( $ ip ) ) { $ list = array_filter ( $ this -> params [ 'allow' ] , [ $ this , 'isIPv6' ] ) ; } else { $ list = array_filter ( $ this -> params [ 'allow' ] , [ $ this , 'isIPv4' ] ) ; } foreach ( $ list as $ range ) { if ( ( strpos ( $ range , '/' ) !== false && $ this -> cidrMatch ( $ ip , $ range ) ) || $ ip === $ range ) { return true ; } } return false ; }
See if an IP address is allowed

@param string $ip An IP address
@return boolean
See if an IP address is allowed