0.9.4claws68
authorChristoph Hohmann <reboot@gmx.ch>
Sun, 7 Sep 2003 00:19:16 +0000 (00:19 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Sun, 7 Sep 2003 00:19:16 +0000 (00:19 +0000)
* src/compose.c
        o make sure we don't have any newlines in header values
        o check custom headers for spaces and newlines and ignore
          malformed header names

ChangeLog.claws
configure.ac
src/compose.c

index 3ac702ba657a8498eccaac4b56d6a19e6c7f4e0c..a7e17905e90faf54a0c911240c2ec0a1cdc7536f 100644 (file)
@@ -1,3 +1,10 @@
+2003-09-07 [christoph] 0.9.4claws68
+
+       * src/compose.c
+               o make sure we don't have any newlines in header values
+               o check custom headers for spaces and newlines and ignore
+                 malformed header names
+
 2003-09-06 [christoph] 0.9.4claws67
 
        * src/folder.c
index 56584f3b25327471d24b3fa7956ff8a9a548185f..acea07a9b682d52b017a8d130aa98a534c094247 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=4
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=67
+EXTRA_VERSION=68
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index a9c28b4e049e019e08857103bc7459531aa566aa..b8d99c5d1b5f7a2c7928d9d8308ee71a34bc9646 100644 (file)
@@ -4349,6 +4349,11 @@ static gint compose_write_headers(Compose *compose, FILE *fp,
                headerentry = ((ComposeHeaderEntry *)list->data);
                
                tmp = g_strdup(gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(headerentry->combo)->entry)));
+               if (strchr(tmp, ' ') != NULL || strchr(tmp, '\r') != NULL || strchr(tmp, '\n') != NULL) {
+                       g_free(tmp);
+                       continue;
+               }
+
                if (!strstr(tmp, ":")) {
                        headername_wcolon = g_strconcat(tmp, ":", NULL);
                        headername = g_strdup(tmp);
@@ -4359,6 +4364,8 @@ static gint compose_write_headers(Compose *compose, FILE *fp,
                g_free(tmp);
                
                headervalue = gtk_entry_get_text(GTK_ENTRY(headerentry->entry));
+               subst_char(headervalue, '\r', ' ');
+               subst_char(headervalue, '\n', ' ');
                string = std_headers;
                while (*string != NULL) {
                        headername_trans = prefs_common.trans_hdr ? gettext(*string) : *string;
@@ -4370,8 +4377,7 @@ static gint compose_write_headers(Compose *compose, FILE *fp,
                        fprintf(fp, "%s %s\n", headername_wcolon, headervalue);
                                
                g_free(headername);
-               g_free(headername_wcolon);
-               
+               g_free(headername_wcolon);              
        }
 
        /* separator between header and body */
@@ -4391,6 +4397,8 @@ static void compose_convert_header(gchar *dest, gint len, gchar *src,
        if (len < 1) return;
 
        g_strchomp(src);
+       subst_char(src, '\n', ' ');
+       subst_char(src, '\r', ' ');
 
        conv_encode_header(dest, len, src, header_len, addr_field);
 }