diff --git a/src/com/android/email/mail/internet/MimeUtility.java b/src/com/android/email/mail/internet/MimeUtility.java index 46e3eb2ee..66b2a7e9f 100644 --- a/src/com/android/email/mail/internet/MimeUtility.java +++ b/src/com/android/email/mail/internet/MimeUtility.java @@ -6,6 +6,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; +import java.util.regex.Pattern; import org.apache.commons.io.IOUtils; import org.apache.james.mime4j.decoder.Base64InputStream; @@ -189,7 +190,9 @@ public class MimeUtility { * @return */ public static boolean mimeTypeMatches(String mimeType, String matchAgainst) { - return mimeType.matches(matchAgainst.replaceAll("\\*", "\\.\\*")); + Pattern p = Pattern.compile(matchAgainst.replaceAll("\\*", "\\.\\*"), + Pattern.CASE_INSENSITIVE); + return p.matcher(mimeType).matches(); } /** @@ -201,7 +204,7 @@ public class MimeUtility { */ public static boolean mimeTypeMatches(String mimeType, String[] matchAgainst) { for (String matchType : matchAgainst) { - if (mimeType.matches(matchType.replaceAll("\\*", "\\.\\*"))) { + if (mimeTypeMatches(mimeType, matchType)) { return true; } }