public function Cleantalk::ct_session_ip in Anti Spam by CleanTalk 7.5
Same name and namespace in other branches
- 7 cleantalk.module \Cleantalk::ct_session_ip()
- 7.2 cleantalk.module \Cleantalk::ct_session_ip()
- 7.4 src/Cleantalk.php \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();
}