Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-06-25 17:58:29 +0300
committerJoas Schilling <coding@schilljs.com>2021-06-25 17:58:29 +0300
commit080e26fb809e5e7d144a0fd9518f8a0c5f6d85e4 (patch)
treec4469521d273dd65a65c698c8515655784dcea1b /apps/theming/lib/ThemingDefaults.php
parent00edbc2adf4d9362041f5611c62967f5a70e5b7e (diff)
Validate the theming color also on CLI
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/theming/lib/ThemingDefaults.php')
-rw-r--r--apps/theming/lib/ThemingDefaults.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/theming/lib/ThemingDefaults.php b/apps/theming/lib/ThemingDefaults.php
index 7e7d9a4fa13..c2ed6e305eb 100644
--- a/apps/theming/lib/ThemingDefaults.php
+++ b/apps/theming/lib/ThemingDefaults.php
@@ -220,7 +220,11 @@ class ThemingDefaults extends \OC_Defaults {
* @return string
*/
public function getColorPrimary() {
- return $this->config->getAppValue('theming', 'color', $this->color);
+ $color = $this->config->getAppValue('theming', 'color', $this->color);
+ if (!preg_match('/^\#([0-9a-f]{3}|[0-9a-f]{6})$/i', $color)) {
+ $color = '#0082c9';
+ }
+ return $color;
}
/**