Xqt has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1282309?usp=email )

Change subject: [bugfix] Remove tracking parameters in FileInfo.url
......................................................................

[bugfix] Remove tracking parameters in FileInfo.url

Bug: T425342
Change-Id: I111157fccadc5f842c90dea14da0d202802e0069
Signed-off-by: Xqt <[email protected]>
---
M pywikibot/page/_filepage.py
1 file changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified




diff --git a/pywikibot/page/_filepage.py b/pywikibot/page/_filepage.py
index 8f5bdb0..e966386 100644
--- a/pywikibot/page/_filepage.py
+++ b/pywikibot/page/_filepage.py
@@ -503,10 +503,15 @@
         """Update FileInfo with new values.

         .. version-added:: 8.6
+        .. version-changed:: 11.3
+           Tracking utm_* parameters are stripped from the url attribute.
         """
         for k, v in file_revision.items():
             if k == 'timestamp':
                 v = pywikibot.Timestamp.fromISOformat(v)
+            elif k == 'url':
+                # remove tracking parameters
+                v = v.split('?', 1)[0]
             setattr(self, k, v)

     def __getitem__(self, key):

--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1282309?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I111157fccadc5f842c90dea14da0d202802e0069
Gerrit-Change-Number: 1282309
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to