Skip to content

Commit

Permalink
Set default_socket_timeout for ipinfo.io checkup
Browse files Browse the repository at this point in the history
  • Loading branch information
slawkens committed Dec 26, 2024
1 parent b2c9eb4 commit e09fe51
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion system/pages/createaccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,9 @@
$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);
Expand Down

0 comments on commit e09fe51

Please sign in to comment.