mirror of
https://github.com/torrentpier/torrentpier-lts.git
synced 2025-02-28 15:10:54 +03:00
Updated
This commit is contained in:
parent
92cb4e1604
commit
d145388e9c
14
common.php
14
common.php
@ -37,10 +37,18 @@ header('X-Frame-Options: SAMEORIGIN');
|
|||||||
header('X-Powered-By: TorrentPier LTS Forever!');
|
header('X-Powered-By: TorrentPier LTS Forever!');
|
||||||
date_default_timezone_set('UTC');
|
date_default_timezone_set('UTC');
|
||||||
|
|
||||||
// Cloudflare
|
// Set remote address
|
||||||
if (isset($_SERVER['HTTP_CF_CONNECTING_IP']))
|
$allowedCDNs = array(
|
||||||
|
'HTTP_X_FORWARDED_FOR',
|
||||||
|
'HTTP_FASTLY_CLIENT_IP',
|
||||||
|
'HTTP_CF_CONNECTING_IP'
|
||||||
|
);
|
||||||
|
foreach ($allowedCDNs as $allowedCDN)
|
||||||
{
|
{
|
||||||
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
|
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
|
// Get initial config
|
||||||
|
Loading…
Reference in New Issue
Block a user