From cef406859703be195ceda68bf108a50c81bbd62c Mon Sep 17 00:00:00 2001 From: Gregor Santner Date: Tue, 21 May 2024 02:00:18 +0200 Subject: [PATCH] Disallow treating openxml (msword) files as textfiles, closes #2285 --- app/src/main/java/net/gsantner/opoc/util/GsFileUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/net/gsantner/opoc/util/GsFileUtils.java b/app/src/main/java/net/gsantner/opoc/util/GsFileUtils.java index 524ba77ec..19a687228 100644 --- a/app/src/main/java/net/gsantner/opoc/util/GsFileUtils.java +++ b/app/src/main/java/net/gsantner/opoc/util/GsFileUtils.java @@ -524,7 +524,7 @@ public static String getMimeType(final File file) { public static boolean isTextFile(File file) { final String mime = getMimeType(file); - return mime != null && (mime.startsWith("text/") || mime.contains("xml")); + return mime != null && (mime.startsWith("text/") || mime.contains("xml")) && !mime.contains("openxml"); } /**