You are here

public static function CleantalkSFW::ip_get in Anti Spam by CleanTalk 7.4

Same name and namespace in other branches
  1. 7.5 src/CleantalkSFW.php \CleantalkSFW::ip_get()

Overrides CleantalkHelper::ip_get

1 call to CleantalkSFW::ip_get()
cleantalk_boot in ./cleantalk.module
Implements hook_boot()

File

src/CleantalkSFW.php, line 40

Class

CleantalkSFW

Code

public static function ip_get($ips_input = array(
  'real',
  'remote_addr',
  'x_forwarded_for',
  'x_real_ip',
  'cloud_flare',
), $v4_only = true) {
  $result = (array) parent::ip_get($ips_input, $v4_only);
  $result = !empty($result) ? $result : array();
  if (isset($_GET['sfw_test_ip'])) {
    if (self::ip_validate($_GET['sfw_test_ip']) !== false) {
      $result['sfw_test'] = $_GET['sfw_test_ip'];
    }
  }
  return $result;
}