mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-05 09:26:06 +00:00
Internet: make getURL() and postURL() return InternetRequestResult objects
this reduces the amount of reference parameters, and generally reduces the number of parameters, while guaranteeing consistency of the APIs.
This commit is contained in:
@ -83,8 +83,8 @@ abstract class Timezone{
|
||||
return;
|
||||
}
|
||||
|
||||
if($response = Internet::getURL("http://ip-api.com/json") //If system timezone detection fails or timezone is an invalid value.
|
||||
and $ip_geolocation_data = json_decode($response, true)
|
||||
if(($response = Internet::getURL("http://ip-api.com/json")) !== null //If system timezone detection fails or timezone is an invalid value.
|
||||
and $ip_geolocation_data = json_decode($response->getBody(), true)
|
||||
and $ip_geolocation_data['status'] !== 'fail'
|
||||
and date_default_timezone_set($ip_geolocation_data['timezone'])
|
||||
){
|
||||
|
Reference in New Issue
Block a user