Merge branch 'master' of github.com:open-keychain/open-keychain
This commit is contained in:
commit
de8eed664f
|
@ -28,6 +28,7 @@ import java.util.ArrayList;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import org.apache.james.mime4j.MimeException;
|
import org.apache.james.mime4j.MimeException;
|
||||||
import org.apache.james.mime4j.codec.DecodeMonitor;
|
import org.apache.james.mime4j.codec.DecodeMonitor;
|
||||||
|
@ -124,14 +125,17 @@ public class InputDataOperation extends BaseOperation<InputDataParcel> {
|
||||||
currentInputUri = input.getInputUri();
|
currentInputUri = input.getInputUri();
|
||||||
}
|
}
|
||||||
|
|
||||||
// don't even attempt if we know the data isn't suitable for mime content
|
// don't even attempt if we know the data isn't suitable for mime content, or if we have a filename
|
||||||
boolean skipMimeParsing = false;
|
boolean skipMimeParsing = false;
|
||||||
if (decryptResult != null && decryptResult.getDecryptionMetadata() != null) {
|
if (decryptResult != null && decryptResult.getDecryptionMetadata() != null) {
|
||||||
String contentType = decryptResult.getDecryptionMetadata().getMimeType();
|
OpenPgpMetadata metadata = decryptResult.getDecryptionMetadata();
|
||||||
if (contentType != null
|
String fileName = metadata.getFilename();
|
||||||
&& !contentType.startsWith("multipart/")
|
String contentType = metadata.getMimeType();
|
||||||
&& !contentType.startsWith("text/")
|
if (!TextUtils.isEmpty(fileName)
|
||||||
&& !contentType.startsWith("application/")) {
|
|| contentType != null
|
||||||
|
&& !contentType.startsWith("multipart/")
|
||||||
|
&& !contentType.startsWith("text/")
|
||||||
|
&& !contentType.startsWith("application/")) {
|
||||||
skipMimeParsing = true;
|
skipMimeParsing = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue