From aa8d9d5b863ae341a6c7774d9398432a2e0eb7de Mon Sep 17 00:00:00 2001 From: Maxime Biais Date: Mon, 15 Feb 2016 09:57:28 +0100 Subject: [PATCH] Fix media isVideo/isValidImage/... utils method --- .../java/org/wordpress/android/util/MediaUtils.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/WordPressUtils/src/main/java/org/wordpress/android/util/MediaUtils.java b/WordPressUtils/src/main/java/org/wordpress/android/util/MediaUtils.java index cea4ce917bea..8e2c773339ce 100644 --- a/WordPressUtils/src/main/java/org/wordpress/android/util/MediaUtils.java +++ b/WordPressUtils/src/main/java/org/wordpress/android/util/MediaUtils.java @@ -33,7 +33,7 @@ public static boolean isValidImage(String url) { if (url == null) { return false; } - + url = url.toLowerCase(); return url.endsWith(".png") || url.endsWith(".jpg") || url.endsWith(".jpeg") || url.endsWith(".gif"); } @@ -41,7 +41,7 @@ public static boolean isDocument(String url) { if (url == null) { return false; } - + url = url.toLowerCase(); return url.endsWith(".doc") || url.endsWith(".docx") || url.endsWith(".odt") || url.endsWith(".pdf"); } @@ -49,7 +49,7 @@ public static boolean isPowerpoint(String url) { if (url == null) { return false; } - + url = url.toLowerCase(); return url.endsWith(".ppt") || url.endsWith(".pptx") || url.endsWith(".pps") || url.endsWith(".ppsx") || url.endsWith(".key"); } @@ -58,7 +58,7 @@ public static boolean isSpreadsheet(String url) { if (url == null) { return false; } - + url = url.toLowerCase(); return url.endsWith(".xls") || url.endsWith(".xlsx"); } @@ -66,6 +66,7 @@ public static boolean isVideo(String url) { if (url == null) { return false; } + url = url.toLowerCase(); return url.endsWith(".ogv") || url.endsWith(".mp4") || url.endsWith(".m4v") || url.endsWith(".mov") || url.endsWith(".wmv") || url.endsWith(".avi") || url.endsWith(".mpg") || url.endsWith(".3gp") || url.endsWith(".3g2") || url.contains("video"); @@ -75,6 +76,7 @@ public static boolean isAudio(String url) { if (url == null) { return false; } + url = url.toLowerCase(); return url.endsWith(".mp3") || url.endsWith(".ogg") || url.endsWith(".wav") || url.endsWith(".wma") || url.endsWith(".aiff") || url.endsWith(".aif") || url.endsWith(".aac") || url.endsWith(".m4a"); }