From 3c85dbd74dc845dae8d5e992fb673575e171074b Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Mon, 4 Apr 2022 16:17:37 -0400 Subject: [PATCH] fix(mail): don't allow XML inline attachments --- UI/MailPartViewers/UIxMailRenderingContext.m | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/UI/MailPartViewers/UIxMailRenderingContext.m b/UI/MailPartViewers/UIxMailRenderingContext.m index ca76bc739..837ac1357 100644 --- a/UI/MailPartViewers/UIxMailRenderingContext.m +++ b/UI/MailPartViewers/UIxMailRenderingContext.m @@ -47,8 +47,7 @@ s = [[info objectForKey:@"disposition"] objectForKey: @"type"]; - shouldDisplay = (s && ([s caseInsensitiveCompare: @"ATTACHMENT"] - == NSOrderedSame)); + shouldDisplay = (s && ([s caseInsensitiveCompare: @"ATTACHMENT"] == NSOrderedSame)); if (!shouldDisplay && !textPart) shouldDisplay = ([[info objectForKey: @"bodyId"] length] ? YES : NO); @@ -216,7 +215,7 @@ static BOOL showNamedTextAttachmentsInline = NO; // TIFF files aren't well-supported and Thunderbird sometimes send PDF // files over as image/pdf ! if ([mt isEqualToString:@"image"] && - !([st isEqualToString: @"tiff"] || [st isEqualToString: @"pdf"])) + !([st isEqualToString: @"tiff"] || [st isEqualToString: @"pdf"] || [st hasSuffix: @"xml"])) { if ([self _shouldDisplayAsAttachment: _info textPart: NO]) return [self linkViewer];