Cloudflare経由でも利用者のIPアドレスを取得できるように修正

This commit is contained in:
konkon-fox 2023-10-13 18:03:04 +09:00
parent 8704541d1c
commit 912da12743
1 changed files with 1 additions and 0 deletions

View File

@ -10,6 +10,7 @@ if (getenv('SKIP_VERIFICATION')) {
$FORCESSL = false;
}
$NOWTIME = time();
if (isset($_SERVER["HTTP_CF_CONNECTING_IP"])) $_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_CF_CONNECTING_IP"];
$HOST = gethostbyaddr($_SERVER['REMOTE_ADDR']);
$area = [];
$area["district"] = $area['proxy'] = $area['hosting'] = $area['regionName'] = $area['city'] = $area['countryCode'] = $area['mobile'] = $area["asname"] = '';