Prefer get_browser_real_ip() over REMOTE_ADDR

This commit is contained in:
slawkens
2024-11-12 20:59:51 +01:00
parent a4a2480995
commit 941846605c
5 changed files with 8 additions and 8 deletions

View File

@@ -331,7 +331,7 @@ if(setting('core.account_country_recognize')) {
$country_recognized = $country_session;
}
else {
$info = json_decode(@file_get_contents('http://ipinfo.io/' . $_SERVER['REMOTE_ADDR'] . '/geo'), true);
$info = json_decode(@file_get_contents('http://ipinfo.io/' . get_browser_real_ip() . '/geo'), true);
if(isset($info['country'])) {
$country_recognized = strtolower($info['country']);
setSession('country', $country_recognized);