From dd9dccbe1d3cbe33b80da33632b63c506be701e9 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 12 Feb 2021 19:58:20 +0100 Subject: [PATCH] Whitelist Facebook query parameters --- .../eu/faircode/email/AdapterMessage.java | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index 389362972e..28c45585f3 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -302,8 +302,14 @@ public class AdapterMessage extends RecyclerView.Adapter FACEBOOK_QUERY = Collections.unmodifiableList(Arrays.asList( - "medium", "ref", "n_m" + // https://github.com/snarfed/granary/blob/master/granary/facebook.py#L1789 + + private static final List FACEBOOK_WHITELIST_PATH = Collections.unmodifiableList(Arrays.asList( + "/nd/", "/n/", "/story.php" + )); + + private static final List FACEBOOK_WHITELIST_QUERY = Collections.unmodifiableList(Arrays.asList( + "story_fbid", "fbid", "id", "comment_id" )); // https://www.iana.org/assignments/imap-jmap-keywords/imap-jmap-keywords.xhtml @@ -6387,14 +6393,26 @@ public class AdapterMessage extends RecyclerView.Adapter