mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-28 20:30:25 +02:00
config: Add [system] => 'timezone'
RSS-Bridge currently statically sets the timezone to UTC which can result in incorrect timestamps if the server is hosted in another region. This commit adds a new configuration parameter to allow admins to specify their own timezone for their servers. Invalid values will result in an error message. Example: [system] timezone = "UTC" For compatibility reasons the default value is set to UTC. This parameter accepts any of the supported timezones listed at https://www.php.net/manual/en/timezones.php Closes #956 References #1001
This commit is contained in:
@@ -155,6 +155,12 @@ final class Configuration {
|
||||
}
|
||||
}
|
||||
|
||||
if(!is_string(self::getConfig('system', 'timezone'))
|
||||
|| !in_array(self::getConfig('system', 'timezone'), timezone_identifiers_list(DateTimeZone::ALL_WITH_BC)))
|
||||
die('Parameter [system] => "timezone" is invalid! Please check "config.ini.php"!');
|
||||
|
||||
date_default_timezone_set(self::getConfig('system', 'timezone'));
|
||||
|
||||
if(!is_string(self::getConfig('proxy', 'url')))
|
||||
die('Parameter [proxy] => "url" is not a valid string! Please check "config.ini.php"!');
|
||||
|
||||
|
Reference in New Issue
Block a user