From eb0af1388724c51af09516c089498e7e81d7d8ad Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Tue, 3 Apr 2018 03:22:29 -0700 Subject: [PATCH] Fix location URL encoding Fixes #7604 --- .../securesms/components/location/SignalPlace.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/org/thoughtcrime/securesms/components/location/SignalPlace.java b/src/org/thoughtcrime/securesms/components/location/SignalPlace.java index ac68fd34e5..3b8566cdfc 100644 --- a/src/org/thoughtcrime/securesms/components/location/SignalPlace.java +++ b/src/org/thoughtcrime/securesms/components/location/SignalPlace.java @@ -1,5 +1,6 @@ package org.thoughtcrime.securesms.components.location; +import android.net.Uri; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.text.TextUtils; @@ -16,7 +17,7 @@ import java.io.IOException; public class SignalPlace { - private static final String URL = "https://maps.google.com/maps?q=%s,%s"; + private static final String URL = "https://maps.google.com/maps"; private static final String TAG = SignalPlace.class.getSimpleName(); @JsonProperty @@ -57,7 +58,10 @@ public class SignalPlace { description += (address + "\n"); } - description += String.format(URL, latitude, longitude); + description += Uri.parse(URL) + .buildUpon() + .appendQueryParameter("q", String.format("%s,%s", latitude, longitude)) + .build().toString(); return description; }