summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-04-26 16:52:48 -0400
committerJune McEnroe <june@causal.agency>2020-04-26 16:52:48 -0400
commit407c7fab874cbbadae7c0f1f961dee4775599278 (patch)
tree2397d5f938d24fa7c185da54438bab4baa3e9322
parentRemove margins in article.message header (diff)
downloadbubger-407c7fab874cbbadae7c0f1f961dee4775599278.tar.gz
bubger-407c7fab874cbbadae7c0f1f961dee4775599278.zip
Fall back to Content-Type name parameter for attachments
Diffstat (limited to '')
-rw-r--r--export.c1
-rw-r--r--html.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/export.c b/export.c
index 7a04358..ab77587 100644
--- a/export.c
+++ b/export.c
@@ -155,6 +155,7 @@ static int exportHTMLAttachment(
 		);
 	}
 	const char *name = paramGet(part->disposition.params, "filename");
+	if (!name) name = paramGet(part->params, "name");
 	const char *disposition = part->disposition.type;
 	if (!disposition) disposition = "INLINE";
 
diff --git a/html.c b/html.c
index 3bd192a..d884b63 100644
--- a/html.c
+++ b/html.c
@@ -275,6 +275,7 @@ int htmlAttachment(
 	);
 	char *url = templateURL("../" PATH_ATTACHMENT, path);
 	const char *name = paramGet(part->disposition.params, "filename");
+	if (!name) name = paramGet(part->params, "name");
 	struct Variable vars[] = {
 		{ "url", url },
 		{ "name", (name ? name : "") },