xhprof
xhprof copied to clipboard
Unable to profile URL behind CDN/Load Balancer (e.g. Cloudflare)
On header.php: if ($controlIPs === false || in_array($_SERVER['REMOTE_ADDR'], $controlIPs) || PHP_SAPI == 'cli')
This will not be vaild if behind reverse proxy e.g: cloudflare / varnish / others
Should be something like this: function getUserIP() { $client = @$_SERVER['HTTP_CLIENT_IP']; $forward = @$_SERVER['HTTP_X_FORWARDED_FOR']; $remote = $_SERVER['REMOTE_ADDR'];
if(filter_var($client, FILTER_VALIDATE_IP))
{
$ip = $client;
}
elseif(filter_var($forward, FILTER_VALIDATE_IP))
{
$ip = $forward;
}
else
{
$ip = $remote;
}
return $ip;
}
Agreed. Please send a PR, where IP address detection will be made using new function.