fix the timezone PR

Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
szaimen 2022-05-23 19:55:50 +02:00
parent 1e82bd757a
commit f2f70904d1
2 changed files with 5 additions and 2 deletions

View file

@ -497,12 +497,15 @@ class ConfigurationManager
return $config['timezone'];
}
/**
* @throws InvalidSettingConfigurationException
*/
public function SetTimezone(string $timezone) : void {
if ($timezone === "") {
throw new InvalidSettingConfigurationException("The timezone must not be empty!");
}
if (!preg_match("#[a-zA-Z0-9_-/+]+$#", $timezone)) {
if (!preg_match("#^[a-zA-Z0-9_\-\/\+]+$#", $timezone)) {
throw new InvalidSettingConfigurationException("The entered timezone does not seem to be a valid timezone!");
}