jenkins-bot has submitted this change and it was merged.
Change subject: Use page title for Content-disposition filename ......................................................................
Use page title for Content-disposition filename
Pywikibot has sent the local filename as the Content-disposition filename since it was first implemented in Pywikibot 2.0: f08b87dd56d4096e82eea6b6f0c35e260b2038f2
This is unnecessary, and leaks the local path of the file. Pywikipedia sends the filename returned by process_filename(), which doesnt include the path.
Change-Id: Ib751ee3f4074a60f3b53b0afe3cc2dfc3e17b2f7 --- M pywikibot/data/api.py 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: John Vandenberg: Looks good to me, but someone else must approve XZise: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py index 2cac9a3..e5cb9f8 100644 --- a/pywikibot/data/api.py +++ b/pywikibot/data/api.py @@ -494,7 +494,7 @@ file_content = file(local_filename, "rb").read() submsg = Request._generate_MIME_part( key, file_content, filetype.split('/'), - {'filename': local_filename}) + {'filename': self._params['filename'][0]}) else: submsg = Request._generate_MIME_part( key, value, None, None)
pywikibot-commits@lists.wikimedia.org