Revert "Update common.php"

This reverts commit fc4df341b3.
This commit is contained in:
Roman Kelesidis 2024-10-31 19:59:35 +07:00
parent fc4df341b3
commit ded29631bf

View File

@ -39,16 +39,16 @@ date_default_timezone_set('UTC');
// Set remote address
$allowedCDNs = array(
'HTTP_X_FORWARDED_FOR',
'HTTP_FASTLY_CLIENT_IP',
'HTTP_CF_CONNECTING_IP'
'HTTP_X_FORWARDED_FOR',
'HTTP_FASTLY_CLIENT_IP',
'HTTP_CF_CONNECTING_IP'
);
foreach ($allowedCDNs as $allowedCDN)
{
if (isset($_SERVER[$allowedCDN]) && filter_var($_SERVER[$allowedCDN], FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE))
{
$_SERVER['REMOTE_ADDR'] = $_SERVER[$allowedCDN];
}
if (isset($_SERVER[$allowedCDN]) && filter_var($_SERVER[$allowedCDN], FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE))
{
$_SERVER['REMOTE_ADDR'] = $_SERVER[$allowedCDN];
}
}
// Get initial config