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
e6a507e1b7
commit
404cdba67a
@ -4,7 +4,7 @@
|
|||||||
[Full Changelog](https://github.com/torrentpier/torrentpier-lts/compare/v2.1.5-2023.10-HotFix...v2.1.5-2024.02)
|
[Full Changelog](https://github.com/torrentpier/torrentpier-lts/compare/v2.1.5-2023.10-HotFix...v2.1.5-2024.02)
|
||||||
|
|
||||||
- Release v2.1.5-2024.02 🎉
|
- Release v2.1.5-2024.02 🎉
|
||||||
- Added Fastly support
|
- Added Fastly CDN support
|
||||||
- Some improvements in default template
|
- Some improvements in default template
|
||||||
- Fixed void function result used
|
- Fixed void function result used
|
||||||
- Feature to ban specific torrent clients
|
- Feature to ban specific torrent clients
|
||||||
|
12
common.php
12
common.php
@ -37,17 +37,15 @@ header('X-Frame-Options: SAMEORIGIN');
|
|||||||
header('X-Powered-By: TorrentPier LTS Forever!');
|
header('X-Powered-By: TorrentPier LTS Forever!');
|
||||||
|
|
||||||
// Set remote address
|
// Set remote address
|
||||||
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
|
$allowedCDNs = ['HTTP_X_FORWARDED_FOR', 'HTTP_FASTLY_CLIENT_IP', 'HTTP_CF_CONNECTING_IP'];
|
||||||
|
foreach ($allowedCDNs as $allowedCDN)
|
||||||
{
|
{
|
||||||
if (isset($_SERVER['HTTP_CF_CONNECTING_IP']))
|
if (isset($_SERVER[$allowedCDN]) && filter_var($_SERVER[$allowedCDN], FILTER_VALIDATE_IP))
|
||||||
{
|
{
|
||||||
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP']; // Cloudflare
|
$_SERVER['REMOTE_ADDR'] = $_SERVER[$allowedCDN];
|
||||||
}
|
|
||||||
elseif (isset($_SERVER['HTTP_FASTLY_CLIENT_IP']))
|
|
||||||
{
|
|
||||||
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_FASTLY_CLIENT_IP']; // Fastly
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
unset($allowedCDNs);
|
||||||
|
|
||||||
// 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