Set default_socket_timeout for ipinfo.io checkup

This commit is contained in:
slawkens 2024-12-26 08:53:40 +01:00
parent b2c9eb4745
commit e09fe51774

View File

@ -302,7 +302,9 @@ if($config['account_country_recognize']) {
$country_recognized = $country_session;
}
else {
$info = json_decode(@file_get_contents('http://ipinfo.io/' . get_browser_real_ip() . '/geo'), true);
ini_set('default_socket_timeout', 5);
$info = json_decode(@file_get_contents('https://ipinfo.io/' . get_browser_real_ip() . '/geo'), true);
if(isset($info['country'])) {
$country_recognized = strtolower($info['country']);
setSession('country', $country_recognized);