summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorCélestin Matte <celestin.matte@gmail.com>2019-11-17 19:21:42 +0100
committerCélestin Matte <celestin.matte@gmail.com>2020-03-20 17:10:56 +0100
commitcd2adbbc3b6108112efc699b573724b362e74282 (patch)
treee6b9a69877a7ed9d6275848cfdcee43f4162bc6e /plugins
parent9df7a439e89debaf70f6d7a62ff0fcd7a9b2499e (diff)
downloadpoezio-cd2adbbc3b6108112efc699b573724b362e74282.tar.gz
poezio-cd2adbbc3b6108112efc699b573724b362e74282.tar.bz2
poezio-cd2adbbc3b6108112efc699b573724b362e74282.tar.xz
poezio-cd2adbbc3b6108112efc699b573724b362e74282.zip
Update remove_get_trackers plugin to only detect GET parameters in a URL context
Diffstat (limited to 'plugins')
-rw-r--r--plugins/remove_get_trackers.py4
1 files 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'])