mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-06 11:39:49 +00:00
Santize shared attachments
This commit is contained in:
parent
a120552a71
commit
5b03b40f1d
1 changed files with 10 additions and 3 deletions
|
@ -171,9 +171,16 @@ public class ActivityCompose extends ActivityBase implements FragmentManager.OnB
|
|||
|
||||
if (intent.hasExtra(Intent.EXTRA_STREAM))
|
||||
if (Intent.ACTION_SEND_MULTIPLE.equals(action)) {
|
||||
ArrayList<Uri> uris = intent.getParcelableArrayListExtra(Intent.EXTRA_STREAM);
|
||||
if (uris != null)
|
||||
args.putParcelableArrayList("attachments", uris);
|
||||
ArrayList<Uri> streams = intent.getParcelableArrayListExtra(Intent.EXTRA_STREAM);
|
||||
if (streams != null) {
|
||||
// Some apps send null streams
|
||||
ArrayList<Uri> uris = new ArrayList<>();
|
||||
for (Uri stream : streams)
|
||||
if (stream != null)
|
||||
uris.add(stream);
|
||||
if (uris.size() > 0)
|
||||
args.putParcelableArrayList("attachments", uris);
|
||||
}
|
||||
} else {
|
||||
Uri stream = intent.getParcelableExtra(Intent.EXTRA_STREAM);
|
||||
if (stream != null) {
|
||||
|
|
Loading…
Add table
Reference in a new issue