From 0cc7a49610f6c94211e1f46c347253ef570df43c Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 28 Jul 2022 18:13:35 +0100 Subject: [PATCH] give an appropriate error msg when disallowing a colon in a custom header --- src/customheader.c | 3 --- src/prefs_customheader.c | 7 ++++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/customheader.c b/src/customheader.c index 40e43e873..b961b7107 100644 --- 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 index bdcde7332..c264d7843 100644 --- 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; -- 2.11.4.GIT