Paul - I've installed your hack as per the instructions, but I'm getting IP addresses being saved by proxy users in the post table such as
192.168.1.7, 82.
172.26.106.249,
unknown, 10.255.
10.20.5.2, 194.2
I'm regarding this is quite a serious error as IP information needs to be correct.
PHP Code:
I've looked at the bit of code which I think gets the real IP in init.php :
// ####################### HN getproxyip START########################
// Establish Proxy Server IP address (if it exists) and Real IP Address
// Make sure forum always uses real client IP address
// Start of Paul Marsden Proxy Hack Modification
if ($_SERVER['HTTP_X_FORWARDED_FOR'] != '')
{
$proxyip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
else if ($_SERVER['HTTP_CLIENT_IP'] != '')
{
$proxyip = $_SERVER['HTTP_CLIENT_IP'];
}
else if ($_SERVER['HTTP_FORWARDED'] != '')
{
$proxyip = $_SERVER['HTTP_FORWARDED'];
}
else
{
$proxyip = '';
}
$proxyip = preg_replace('/javascript/i', 'java script', $proxyip);
$proxyip = str_replace('"', '"', $proxyip);
$proxyip = str_replace('<', '<', $proxyip);
$proxyip = str_replace('>', '>', $proxyip);
if (!preg_match("#\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}#", $proxyip))
{
$proxyip = '';
}
if ($proxyip == '')
{
define('PROXYIP', '');
define('IPADDRESS', $_SERVER['REMOTE_ADDR']);
}
else
{
define('PROXYIP', $_SERVER['REMOTE_ADDR']);
define('IPADDRESS', $proxyip);
}
unset($proxyip);
// End of Paul Marsden Proxy Hack Modification
// ####################### HN getproxyip END ########################
Is this code in error?
Please help!