You are here

private function SFW::ip_get in Anti Spam by CleanTalk 8.3

1 call to SFW::ip_get()
SFW::check_ip in src/lib/Cleantalk/Antispam/SFW.php

File

src/lib/Cleantalk/Antispam/SFW.php, line 42

Class

SFW

Namespace

Drupal\cleantalk\lib\Cleantalk\Antispam

Code

private function ip_get($v4_only = true) {
  $real_ip = (array) CleantalkHelper::ip_get(array(
    'real',
  ), $v4_only);
  $real_ip = !empty($real_ip) ? $real_ip[0] : '';
  $this->ips_array['real'] = array(
    'ip' => $real_ip,
    'in_list' => false,
  );
  if (isset($_GET['sfw_test_ip'])) {
    if (CleantalkHelper::ip_validate($_GET['sfw_test_ip']) !== false) {
      $this->ips_array['test'] = array(
        'ip' => $_GET['sfw_test_ip'],
        'in_list' => false,
      );
    }
  }
}