mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Timezone: properly account for failure to read timezone file
This commit is contained in:
parent
372202b3dc
commit
83c40f4502
@ -152,7 +152,7 @@ abstract class Timezone{
|
||||
// Ubuntu / Debian.
|
||||
if(file_exists('/etc/timezone')){
|
||||
$data = file_get_contents('/etc/timezone');
|
||||
if($data){
|
||||
if($data !== false){
|
||||
return trim($data);
|
||||
}
|
||||
}
|
||||
@ -160,7 +160,7 @@ abstract class Timezone{
|
||||
// RHEL / CentOS
|
||||
if(file_exists('/etc/sysconfig/clock')){
|
||||
$data = parse_ini_file('/etc/sysconfig/clock');
|
||||
if(isset($data['ZONE']) and is_string($data['ZONE'])){
|
||||
if($data !== false and isset($data['ZONE']) and is_string($data['ZONE'])){
|
||||
return trim($data['ZONE']);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user