Version 2.3.1

keepsession时伪造ip访问
This commit is contained in:
firesun
2015-10-31 14:32:22 +08:00
parent 4534a9b567
commit 424ba76764

View File

@@ -31,17 +31,21 @@ if(KEEP_SESSION)
if(isset($info['headers_data']['User-Agent']))
$useragent=$info['headers_data']['User-Agent'];
$ip=$info['user_IP'];
if($url!="" && $cookie!="")
{
$ch = curl_init();
$header[]= 'User-Agent: '.$useragent;
$header[]= 'Cookie: '.$cookie;
$header[]= 'X-Forwarded-For: '.$ip;
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_HTTPHEADER,$header);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch, CURLOPT_TIMEOUT,10);
//https不校验证书按需开启吧
//curl_setopt ( $curl_handle, CURLOPT_SSL_VERIFYHOST, 0 );
curl_exec($ch);
curl_close($ch);
}