Skip to content

Commit e5c9890

Browse files
Merge pull request #57394 from nextcloud/bugfix/noid/theming-links
fix(settings): Allow clearing legal and privacy links
2 parents 62513df + 649e042 commit e5c9890

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

apps/theming/lib/Controller/ThemingController.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function updateStylesheet($setting, $value) {
9292
if (strlen($value) > 500) {
9393
$error = $this->l10n->t('The given legal notice address is too long');
9494
}
95-
if (!$this->isValidUrl($value)) {
95+
if ($value !== '' && !$this->isValidUrl($value)) {
9696
$error = $this->l10n->t('The given legal notice address is not a valid URL');
9797
}
9898
break;
@@ -103,7 +103,7 @@ public function updateStylesheet($setting, $value) {
103103
if (strlen($value) > 500) {
104104
$error = $this->l10n->t('The given privacy policy address is too long');
105105
}
106-
if (!$this->isValidUrl($value)) {
106+
if ($value !== '' && !$this->isValidUrl($value)) {
107107
$error = $this->l10n->t('The given privacy policy address is not a valid URL');
108108
}
109109
break;
@@ -308,6 +308,8 @@ public function undo(string $setting): DataResponse {
308308
$setting = match ($setting) {
309309
'primaryColor' => 'primary_color',
310310
'backgroundColor' => 'background_color',
311+
'legalNoticeUrl' => 'imprintUrl',
312+
'privacyPolicyUrl' => 'privacyUrl',
311313
default => $setting,
312314
};
313315
$value = $this->themingDefaults->undo($setting);

0 commit comments

Comments
 (0)