mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-11 14:05:35 +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.
|
// Ubuntu / Debian.
|
||||||
if(file_exists('/etc/timezone')){
|
if(file_exists('/etc/timezone')){
|
||||||
$data = file_get_contents('/etc/timezone');
|
$data = file_get_contents('/etc/timezone');
|
||||||
if($data){
|
if($data !== false){
|
||||||
return trim($data);
|
return trim($data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -160,7 +160,7 @@ abstract class Timezone{
|
|||||||
// RHEL / CentOS
|
// RHEL / CentOS
|
||||||
if(file_exists('/etc/sysconfig/clock')){
|
if(file_exists('/etc/sysconfig/clock')){
|
||||||
$data = parse_ini_file('/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']);
|
return trim($data['ZONE']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user