Signed-off-by: Joas Schilling <coding@schilljs.com>
$key = $key . 'Mime';
}
+ if ($key === 'color' && !preg_match('/^\#([0-9a-f]{3}|[0-9a-f]{6})$/i', $value)) {
+ $output->writeln('<error>The given color is invalid: ' . $value . '</error>');
+ return 1;
+ }
+
$this->themingDefaults->set($key, $value);
$output->writeln('<info>Updated ' . $key . ' to ' . $value . '</info>');
* @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;
}
/**