Typecho获取访客真实ip

由于本站套个各种cdn,导致最后无法获取访客ip
抱着试试的心态把之前看到的代码加了进去,没想到还真成了
将本代码插入到config.inc.php文件中~

//CDN清空下获取访客IP
if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$list = explode(',',$_SERVER['HTTP_X_FORWARDED_FOR']);
$_SERVER['REMOTE_ADDR'] = $list[0];
}