diff options
author | Ekin Oguz <ekinoguz@google.com> | 2018-06-04 13:35:50 -0700 |
---|---|---|
committer | WolfEnders <grzwolf1@gmail.com> | 2018-08-11 18:47:15 +0200 |
commit | b1c43d73a05c8a4c9c087f020e0fe14ccfd9eb31 (patch) | |
tree | 1399c98e0a4779793e671586d87bc34c3aba33f6 /src | |
parent | 48d8629670def5298e03fdfd2eb89504ba2844ee (diff) | |
download | android_packages_apps_UnifiedEmail-b1c43d73a05c8a4c9c087f020e0fe14ccfd9eb31.tar.gz android_packages_apps_UnifiedEmail-b1c43d73a05c8a4c9c087f020e0fe14ccfd9eb31.tar.bz2 android_packages_apps_UnifiedEmail-b1c43d73a05c8a4c9c087f020e0fe14ccfd9eb31.zip |
Filter Attachment file name of forward slashes for .eml attachments.
Bug: b/66230183
Change-Id: I6715358a07bc5bd9de6ee877b4a235a974767536
(cherry picked from commit 53b40fd185517ca82a0c4305570c5a5e3b83abf0)
Diffstat (limited to 'src')
-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 bc73fcff1..678df1f25 100644 --- a/src/com/android/mail/providers/Attachment.java +++ b/src/com/android/mail/providers/Attachment.java @@ -262,6 +262,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, partId); contentUri = uri; |