Fix location URL encoding

Fixes #7604
pull/1/head
Moxie Marlinspike 6 years ago
parent 72310ed3c6
commit eb0af13887

@ -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;
}

Loading…
Cancel
Save