From 62bc889b122713e2390258415fe448476d17c8bf Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 2 May 2020 16:36:14 +0200 Subject: [PATCH] Sanitize amp URIs --- .../eu/faircode/email/AdapterMessage.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index 1271c62513..944e14150b 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -5500,6 +5500,30 @@ public class AdapterMessage extends RecyclerView.Adapter 0) { + String segment = u.substring(0, p); + if (segment.contains(".")) { + result = Uri.parse("https://" + u); + break; + } + + u = u.substring(p + 1); + p = u.indexOf("/"); + } + + changed = (result != null); + url = (result == null ? uri : result); } else url = uri;