diff options
-rw-r--r-- | src/com/android/mail/providers/Attachment.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/com/android/mail/providers/Attachment.java b/src/com/android/mail/providers/Attachment.java index b8e86edeb..af4b3e326 100644 --- a/src/com/android/mail/providers/Attachment.java +++ b/src/com/android/mail/providers/Attachment.java @@ -245,6 +245,11 @@ public class Attachment implements Parcelable { name = MimeUtility.getHeaderParameter(contentDisposition, "filename"); } + // Prevent passing in a file path as part of the name. + if (name != null) { + name = name.replace('/', '_'); + } + contentType = MimeType.inferMimeType(name, part.getMimeType()); uri = EmlAttachmentProvider.getAttachmentUri(emlFileUri, messageId, cid); contentUri = uri; |