diff --git a/php/src/Data/ConfigurationManager.php b/php/src/Data/ConfigurationManager.php
index 40ecbdde..60fa28b3 100644
--- a/php/src/Data/ConfigurationManager.php
+++ b/php/src/Data/ConfigurationManager.php
@@ -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!");
}
diff --git a/php/templates/containers.twig b/php/templates/containers.twig
index 74ade259..e09f105a 100644
--- a/php/templates/containers.twig
+++ b/php/templates/containers.twig
@@ -414,7 +414,7 @@
- You need to make sure that the timezone that you enter is valid. An example is Europe/Berlin. You can get valid values by looking at the 'TZ database name' column of this list: click here.
+ You need to make sure that the timezone that you enter is valid. An example is Europe/Berlin. You can get valid values by looking at the 'TZ database name' column of this list: click here.
{% else %}
The timezone for Nextcloud is currently set to {{ timezone }}. You can reset the timezone again by clicking on the button below.