aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-06-16 23:36:34 +0200
committerChristian Schneppe <christian@pix-art.de>2018-06-16 23:36:34 +0200
commit0e51d1fd4121a884ad09793945e4e0b60e3ffa18 (patch)
tree760f900f89e994c20826964b752490338412af6a /src/main/java/de/pixart
parent8b823e5aa5bfc76d3b0cba873c8f6e0a185d1808 (diff)
fix geo uri regex
- only match valid float numbers - match uri with parameter
Diffstat (limited to 'src/main/java/de/pixart')
-rw-r--r--src/main/java/de/pixart/messenger/utils/GeoHelper.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/utils/GeoHelper.java b/src/main/java/de/pixart/messenger/utils/GeoHelper.java
index d2963f206..209fd75db 100644
--- a/src/main/java/de/pixart/messenger/utils/GeoHelper.java
+++ b/src/main/java/de/pixart/messenger/utils/GeoHelper.java
@@ -19,7 +19,7 @@ import de.pixart.messenger.ui.ShowLocationActivity;
public class GeoHelper {
- public static Pattern GEO_URI = Pattern.compile("geo:([\\-0-9.]+),([\\-0-9.]+)(?:,([\\-0-9.]+))?(?:\\?(.*))?", Pattern.CASE_INSENSITIVE);
+ public static Pattern GEO_URI = Pattern.compile("geo:(-?\\d+(?:\\.\\d+)?),(-?\\d+(?:\\.\\d+)?)(?:,-?\\d+(?:\\.\\d+)?)?(?:;crs=[\\w-]+)?(?:;u=\\d+(?:\\.\\d+)?)?(?:;[\\w-]+=(?:[\\w-_.!~*'()]|%[\\da-f][\\da-f])+)*", Pattern.CASE_INSENSITIVE);
public static String MapPreviewUri(Message message) {
Matcher matcher = GEO_URI.matcher(message.getBody());