From cd2adbbc3b6108112efc699b573724b362e74282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9lestin=20Matte?= Date: Sun, 17 Nov 2019 19:21:42 +0100 Subject: Update remove_get_trackers plugin to only detect GET parameters in a URL context --- plugins/remove_get_trackers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/remove_get_trackers.py b/plugins/remove_get_trackers.py index 9c1eb9c1..423e9b4e 100644 --- a/plugins/remove_get_trackers.py +++ b/plugins/remove_get_trackers.py @@ -17,6 +17,6 @@ class Plugin(BasePlugin): # ref_src, ref_url: twitter # Others exist but are excluded because they are not common. # See https://en.wikipedia.org/wiki/UTM_parameters - msg['body'] = re.sub('&?(fbclid|dclid|ncid|utm_source|utm_medium|utm_campaign|utm_term|utm_content|ref_src|ref_url)=[^ &#]*', - '', + msg['body'] = re.sub('(https?://[^ ]+)&?(fbclid|dclid|ncid|utm_source|utm_medium|utm_campaign|utm_term|utm_content|ref_src|ref_url)=[^ &#]*', + r'\1', msg['body']) -- cgit v1.2.3