Update remove_get_trackers plugin to only detect GET parameters in a URL context

This commit is contained in:
Célestin Matte 2019-11-17 19:21:42 +01:00
parent 9df7a439e8
commit cd2adbbc3b

View file

@ -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'])