aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs
diff options
context:
space:
mode:
authorDaniel Gultsch <inputmice@siacs.eu>2015-01-04 23:04:23 +0100
committerDaniel Gultsch <inputmice@siacs.eu>2015-01-04 23:04:23 +0100
commit2723c9ccb938e073b4c8cd26e39553a31bcbfdbe (patch)
tree3ab45bbc9505737346be36dfee4a43f52a96e917 /src/main/java/eu/siacs
parent3522243835fd29751109cb578897b4e403f06b7d (diff)
made checks for valid image extensions case insensitive
Diffstat (limited to 'src/main/java/eu/siacs')
-rw-r--r--src/main/java/eu/siacs/conversations/entities/Message.java2
-rw-r--r--src/main/java/eu/siacs/conversations/http/HttpConnection.java2
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Message.java b/src/main/java/eu/siacs/conversations/entities/Message.java
index b5a1897d..8cb48635 100644
--- a/src/main/java/eu/siacs/conversations/entities/Message.java
+++ b/src/main/java/eu/siacs/conversations/entities/Message.java
@@ -395,7 +395,7 @@ public class Message extends AbstractEntity {
String[] pathParts = url.getPath().split("/");
String filename;
if (pathParts.length > 0) {
- filename = pathParts[pathParts.length - 1];
+ filename = pathParts[pathParts.length - 1].toLowerCase();
} else {
return false;
}
diff --git a/src/main/java/eu/siacs/conversations/http/HttpConnection.java b/src/main/java/eu/siacs/conversations/http/HttpConnection.java
index 5348e395..b715c3f3 100644
--- a/src/main/java/eu/siacs/conversations/http/HttpConnection.java
+++ b/src/main/java/eu/siacs/conversations/http/HttpConnection.java
@@ -65,7 +65,7 @@ public class HttpConnection implements Downloadable {
this.message.setDownloadable(this);
try {
mUrl = new URL(message.getBody());
- String path = mUrl.getPath();
+ String path = mUrl.getPath().toLowerCase();
if (path != null && (path.endsWith(".pgp") || path.endsWith(".gpg"))) {
this.message.setEncryption(Message.ENCRYPTION_PGP);
} else if (message.getEncryption() != Message.ENCRYPTION_OTR) {
diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java
index d6f901d8..ff94563c 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java
@@ -280,7 +280,7 @@ public class JingleConnection implements Downloadable {
Element fileNameElement = fileOffer.findChild("name");
if (fileNameElement != null) {
String[] filename = fileNameElement.getContent()
- .toLowerCase(Locale.US).split("\\.");
+ .toLowerCase(Locale.US).toLowerCase().split("\\.");
if (Arrays.asList(VALID_IMAGE_EXTENSIONS).contains(
filename[filename.length - 1])) {
message.setType(Message.TYPE_IMAGE);