From fc4df341b342f4dddf9c19c4194f6adb172dbbb5 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 31 Oct 2024 19:53:47 +0700 Subject: [PATCH] Update common.php --- common.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/common.php b/common.php index 5e24c346..bb3f36a8 100644 --- a/common.php +++ b/common.php @@ -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