You are here

static function Helper::ip__is_private_network in Anti Spam by CleanTalk 9.1.x

Same name and namespace in other branches
  1. 8.4 src/lib/Cleantalk/Common/Helper.php \Cleantalk\Common\Helper::ip__is_private_network()

* Checks if the IP is in private range * *

Parameters

string $ip: * @param string $ip_type * * @return bool

1 call to Helper::ip__is_private_network()
Helper::ip__get in src/lib/Cleantalk/Common/Helper.php
Getting arrays of IP (REMOTE_ADDR, X-Forwarded-For, X-Real-Ip, Cf_Connecting_Ip)

File

src/lib/Cleantalk/Common/Helper.php, line 281

Class

Helper
CleanTalk Helper class. Compatible with any CMS.

Namespace

Cleantalk\Common

Code

static function ip__is_private_network($ip, $ip_type = 'v4') {
  return self::ip__mask_match($ip, self::$private_networks[$ip_type], $ip_type);
}