You are here

public function Cleantalk::ct_session_ip in Anti Spam by CleanTalk 7.4

Same name and namespace in other branches
  1. 7.5 src/Cleantalk.php \Cleantalk::ct_session_ip()
  2. 7 cleantalk.module \Cleantalk::ct_session_ip()
  3. 7.2 cleantalk.module \Cleantalk::ct_session_ip()

Get user IP behind proxy server

File

src/Cleantalk.php, line 612

Class

Cleantalk
Cleantalk Base class

Code

public function ct_session_ip($data_ip) {
  if (!$data_ip || !preg_match("/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\$/", $data_ip)) {
    return $data_ip;
  }
  return self::cleantalk_get_real_ip();
}