mirror of
https://github.com/torrentpier/torrentpier-lts.git
synced 2025-02-28 15:10:54 +03:00
Update common.php
This commit is contained in:
parent
780ec18fdd
commit
11f833d571
10
common.php
10
common.php
@ -38,15 +38,15 @@ header('X-Powered-By: TorrentPier LTS Forever!');
|
|||||||
date_default_timezone_set('UTC');
|
date_default_timezone_set('UTC');
|
||||||
|
|
||||||
// Set remote address
|
// Set remote address
|
||||||
$allowedCDNs = ['HTTP_X_FORWARDED_FOR', 'HTTP_FASTLY_CLIENT_IP', 'HTTP_CF_CONNECTING_IP'];
|
$allowed_cdn = array('HTTP_X_FORWARDED_FOR', 'HTTP_FASTLY_CLIENT_IP', 'HTTP_CF_CONNECTING_IP');
|
||||||
foreach ($allowedCDNs as $allowedCDN)
|
foreach ($allowed_cdn as $cdn)
|
||||||
{
|
{
|
||||||
if (isset($_SERVER[$allowedCDN]) && filter_var($_SERVER[$allowedCDN], FILTER_VALIDATE_IP))
|
if (isset($_SERVER[$cdn]) && filter_var($_SERVER[$cdn], FILTER_VALIDATE_IP))
|
||||||
{
|
{
|
||||||
$_SERVER['REMOTE_ADDR'] = $_SERVER[$allowedCDN];
|
$_SERVER['REMOTE_ADDR'] = $_SERVER[$cdn];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unset($allowedCDNs);
|
unset($allowed_cdn);
|
||||||
|
|
||||||
// Get initial config
|
// Get initial config
|
||||||
if (file_exists(BB_ROOT . 'library/config.local.php'))
|
if (file_exists(BB_ROOT . 'library/config.local.php'))
|
||||||
|
Loading…
Reference in New Issue
Block a user