commit 0cc7a49610f6c94211e1f46c347253ef570df43c
parent e134be0de9ad9be730ab984a557991a8fae24970
Author: Paul <paul@claws-mail.org>
Date: Thu, 28 Jul 2022 18:13:35 +0100
give an appropriate error msg when disallowing a colon in a custom header
Diffstat:
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/customheader.c b/src/customheader.c
@@ -103,9 +103,6 @@ gboolean custom_header_is_allowed(const gchar *header)
{
cm_return_val_if_fail(header != NULL, FALSE);
- if (strchr(header, ':') != NULL)
- return FALSE;
-
if (g_ascii_strcasecmp(header, "Date") != 0 &&
g_ascii_strcasecmp(header, "From") != 0 &&
g_ascii_strcasecmp(header, "To") != 0 &&
diff --git a/src/prefs_customheader.c b/src/prefs_customheader.c
@@ -499,7 +499,12 @@ static void prefs_custom_header_list_view_set_row(PrefsAccount *ac)
(*entry_text == '\n' || *entry_text == '\r' ||
*entry_text == '\t' || *entry_text == ' '))
entry_text++;
-
+
+ if (strchr(entry_text, ':') != NULL) {
+ alertpanel_error(_("A colon (:) is not allowed in a custom header."));
+ return;
+ }
+
if (!custom_header_is_allowed(entry_text)) {
alertpanel_error(_("This Header name is not allowed as a custom header."));
return;