Beispiel #1
0
 public function ipIsValid($ip)
 {
     try {
         return IpAddress::ipV4Valid($ip) || $this->validCountry($ip);
     } catch (Exception $e) {
         return false;
     }
 }
Beispiel #2
0
 private function checkSecondaryLists($ip_address)
 {
     if (!$this->config->get('enable_range_search')) {
         return false;
     }
     foreach ($this->dataRepository->firewall->all() as $range) {
         if (IpAddress::ipV4Valid($range['ip_address']) && ipv4_in_range($ip_address, $range['ip_address'])) {
             return $range;
         }
     }
     return false;
 }
Beispiel #3
0
 private function getIpsFromAnything($item)
 {
     if (starts_with($item, 'country:')) {
         return array($item);
     }
     if (IpAddress::ipV4Valid($item)) {
         return array($item);
     }
     return $this->readFile($item);
 }