mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
my attempt to break the source. :D
The Cache-Control change may stay or may not stay. fixed: php3 compliance within the emailer. :) git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@4073 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -130,10 +130,21 @@ if( getenv('HTTP_X_FORWARDED_FOR') != '' )
|
||||
{
|
||||
$client_ip = ( !empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : $REMOTE_ADDR );
|
||||
|
||||
if ( preg_match("/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/", getenv('HTTP_X_FORWARDED_FOR'), $ip_list) )
|
||||
$entries = explode(',', getenv('HTTP_X_FORWARDED_FOR'));
|
||||
reset($entries);
|
||||
while (list(, $entry) = each($entries))
|
||||
{
|
||||
$private_ip = array('/^0\./', '/^127\.0\.0\.1/', '/^192\.168\..*/', '/^172\.16\..*/', '/^10\..*/', '/^224\..*/', '/^240\..*/');
|
||||
$client_ip = preg_replace($private_ip, $client_ip, $ip_list[1]);
|
||||
$entry = trim($entry);
|
||||
if ( preg_match("/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/", $entry, $ip_list) )
|
||||
{
|
||||
$private_ip = array('/^0\./', '/^127\.0\.0\.1/', '/^192\.168\..*/', '/^172\.16\..*/', '/^10\..*/', '/^224\..*/', '/^240\..*/');
|
||||
$found_ip = preg_replace($private_ip, $client_ip, $ip_list[1]);
|
||||
if ($client_ip != $found_ip)
|
||||
{
|
||||
$client_ip = $found_ip;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user