summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-07-20 00:21:25 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-07-20 00:21:25 +0000
commit07ccb4cf2e18aa5137a19240ddc3e9893b041564 (patch)
treea260685a05d91b99d621e110b05d524518634dc9
parente46e79c3202747b5e44a34d23904319620403aa9 (diff)
parent76c5261a03c8402e893999196651afc5791ca0fd (diff)
downloadUnifiedEmail-oreo-m4-s11-release.tar.gz
Merge cherrypicks of [4583929, 4582754, 4582755, 4582756, 4583930, 4583931, 4583932, 4586307, 4586953, 4582585, 4586964, 4586965, 4586984, 4586985, 4586986, 4586987, 4586966, 4582586, 4582885, 4586531, 4586532, 4586533, 4586535, 4586536, 4586537, 4586538, 4586539, 4586540, 4586541, 4586542, 4586890, 4586891, 4586892, 4586893, 4586894, 4586895, 4586896, 4586897, 4586898, 4586899, 4586900, 4586901, 4586902, 4586903, 4587104, 4587105, 4587106, 4586988, 4583933, 4583934, 4583935, 4586989, 4586990, 4587136, 4587138, 4586991, 4586308, 4586967, 4587069, 4587070, 4582886, 4582887, 4587164, 4582888, 4587027, 4587028, 4587029, 4587030, 4582587, 4582588, 4582589, 4582590, 4582591, 4582592, 4582593, 4582594, 4582595, 4582596, 4582597, 4582598, 4582599, 4582600, 4582601, 4582602, 4582603, 4587244, 4587245, 4587246, 4587247, 4587248, 4587249, 4587250, 4587251, 4587252, 4582760, 4583936, 4582761, 4586992, 4587229, 4587230, 4587231, 4587253, 4586968] into sparse-4732991-L37700000192334752android-8.1.0_r42oreo-m4-s11-release
Change-Id: I37d3b56aea5b66636776bb4725940166f1e6aea6
-rw-r--r--src/com/android/mail/providers/Attachment.java5
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 4ed33f83e..7f56d1dd0 100644
--- a/src/com/android/mail/providers/Attachment.java
+++ b/src/com/android/mail/providers/Attachment.java
@@ -256,6 +256,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;