Error Handler In Reverse Proxy Setup Does Not Log Correct Host (Zoop 1.3 And 1.5)

If you have a reverse proxy setup in front our your Web Server the $_SERVER['REMOTE_ADDR'] only refers to the proxy server. More information about the client is actually available in $_SERVER['HTTP_X_FORWARDED_FOR']. Please see below for the correction to the code for both Zoop 1.3 and 1.5.

{zoop_dir}/app/error.php

function AddMiscErrorInfo()
{
	$info = array();
	if(php_sapi_name() != "cli")
	{
		$info["_SERVER"][] = "REMOTE_ADDR";
		$info["_SERVER"][] = "HTTP_USER_AGENT";
		$info["_SERVER"][] = "HTTP_REFERER";
		$info["_SERVER"][] = "HTTP_COOKIE";
		$info["_SERVER"][] = "HTTP_X_FORWARDED_FOR";  //Add this to line 130 in Zoop 1.3 and line 190 in Zoop 1.5
	}
	$info['sGlobals'] = 1;
	$info['sUrls'] = 1;
 
	return $info;
}

Updated repository

Zoop has been updated in the repository with this fix.

jmorant@cloud9l... 23 Nov 2009