aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Dmitry Isaikin <isaikin-dmitry@yandex.ru>2016-04-26 19:34:21 +0300
committerGravatar HoĆ  V. DINH <dinh.viet.hoa@gmail.com>2016-04-26 09:34:21 -0700
commit23305f3df8bf4951476c5cd7b143fdd910cdbb08 (patch)
treeb583524a8b99e47781423a891844b6246d7e4349
parent1d13ae87d3e061ce5818a0c0f5c415c37322b8a7 (diff)
Handle case with parsing parts info with non-empty content name and empty non-null attachment filename. (#1407)
BODYSTRUCTURE ((("text" "plain" ("charset" "utf-8") NIL NIL "base64" 58 1 NIL NIL NIL NIL)("text" "html" ("charset" "utf-8") NIL NIL "base64" 112 2 NIL NIL NIL NIL) "alternative" ("boundary" "--ALT--tVxePtRpLBZY6Hs0ao1c7BSGQcoQy5ur1460647449") NIL NIL NIL)("video" "quicktime" ("name" "=?UTF-8?B?Mi5tb3Y=?=") NIL NIL "base64" 3722950 NIL ("attachment" ("filename" "")) NIL NIL)("video" "quicktime" ("name" "=?UTF-8?B?MS5tb3Y=?=") NIL NIL "base64" 3941584 NIL ("attachment" ("filename" "")) NIL NIL)("video" "quicktime" ("name" "=?UTF-8?B?My5tb3Y=?=") NIL NIL "base64" 15571848 NIL ("attachment" ("filename" "")) NIL NIL) "mixed" ("boundary" "----tVxePtRpLBZY6Hs0ao1c7BSGQcoQy5ur-lcGxoWOFOYrZWofU-1460647449") NIL NIL NIL)
-rw-r--r--src/core/abstract/MCAbstractPart.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/abstract/MCAbstractPart.cpp b/src/core/abstract/MCAbstractPart.cpp
index 0956368c..93578808 100644
--- a/src/core/abstract/MCAbstractPart.cpp
+++ b/src/core/abstract/MCAbstractPart.cpp
@@ -260,7 +260,10 @@ void AbstractPart::importIMAPFields(struct mailimap_body_fields * fields,
imap_param = (struct mailimap_single_body_fld_param *) clist_content(cur);
if (strcasecmp(imap_param->pa_name, "filename") == 0) {
- setFilename(String::stringByDecodingMIMEHeaderValue(imap_param->pa_value));
+ String * filename = String::stringByDecodingMIMEHeaderValue(imap_param->pa_value);
+ if (filename != NULL && filename->length() > 0) {
+ setFilename(filename);
+ }
}
}
}