mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
treeviz flatdata experiment + better invalid TZ handling
This commit is contained in:
@@ -8,6 +8,7 @@ $configFolderPath = dirname(__FILE__)."/../../../config/";
|
||||
$config_file = "app.conf";
|
||||
$logFolderPath = "/app/log/";
|
||||
$log_file = "app_front.log";
|
||||
$default_tz = "Europe/Berlin";
|
||||
|
||||
|
||||
$fullConfPath = $configFolderPath.$config_file;
|
||||
@@ -29,7 +30,13 @@ foreach ($config_file_lines as $line)
|
||||
|
||||
if($timeZone == "")
|
||||
{
|
||||
$timeZone = "Europe/Berlin";
|
||||
$timeZone = $default_tz;
|
||||
}
|
||||
|
||||
// Validate the timezone
|
||||
if (!in_array($timeZone, timezone_identifiers_list())) {
|
||||
error_log("Invalid timezone '$timeZone' in config. Falling back to default: '$default_tz' ");
|
||||
$timeZone = $default_tz;
|
||||
}
|
||||
|
||||
date_default_timezone_set($timeZone);
|
||||
|
||||
Reference in New Issue
Block a user