John Vandenberg has uploaded a new change for review.
https://gerrit.wikimedia.org/r/165588
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: f08b87d
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(-)
git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core
refs/changes/88/165588/1
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)
--
To view, visit https://gerrit.wikimedia.org/r/165588
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib751ee3f4074a60f3b53b0afe3cc2dfc3e17b2f7
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits