Fixes capitilization of header

This commit is contained in:
2023-11-01 14:09:43 -04:00
parent 50cb774194
commit 9cce60ed37

View File

@@ -1,10 +1,10 @@
<?php
// Will check if this is requested through cloudflare
if (array_key_exists("cf-connecting-ip", apache_request_headers())) {
$address = sanitize(apache_request_headers()["cf-connecting-ip"]);
if (! $address) {
if (array_key_exists("Cf-Connecting-Ip", apache_request_headers())) {
$address = sanitize(apache_request_headers()["Cf-Connecting-Ip"]);
if (!$address) {
$address = $_SERVER["REMOTE_ADDR"]; // Variable that stores the IP address of user accessing the website
}
} else {
$address = $_SERVER["REMOTE_ADDR"];
}
}