mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-17 04:06:54 +00:00
Timezone: properly account for failure to read timezone file
This commit is contained in:
@@ -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']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user