Set default_socket_timeout for ipinfo.io checkup

This commit is contained in:
slawkens 2024-12-20 22:42:35 +01:00
parent 988a3f2dbe
commit 783d96fc65

View File

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