mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-19 18:04:07 +00:00
Timezone: fix some implicit boolean type conversions
This commit is contained in:
parent
686bf398d5
commit
5f3c9e6f19
@ -76,7 +76,7 @@ abstract class Timezone{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(($timezone = self::detectSystemTimezone()) and date_default_timezone_set($timezone)){
|
if(($timezone = self::detectSystemTimezone()) !== false and date_default_timezone_set($timezone)){
|
||||||
//Success! Timezone has already been set and validated in the if statement.
|
//Success! Timezone has already been set and validated in the if statement.
|
||||||
//This here is just for redundancy just in case some program wants to read timezone data from the ini.
|
//This here is just for redundancy just in case some program wants to read timezone data from the ini.
|
||||||
ini_set("date.timezone", $timezone);
|
ini_set("date.timezone", $timezone);
|
||||||
@ -84,7 +84,7 @@ abstract class Timezone{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(($response = Internet::getURL("http://ip-api.com/json")) !== null //If system timezone detection fails or timezone is an invalid value.
|
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 is_array($ip_geolocation_data = json_decode($response->getBody(), true))
|
||||||
and $ip_geolocation_data['status'] !== 'fail'
|
and $ip_geolocation_data['status'] !== 'fail'
|
||||||
and date_default_timezone_set($ip_geolocation_data['timezone'])
|
and date_default_timezone_set($ip_geolocation_data['timezone'])
|
||||||
){
|
){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user