1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-16 10:29:54 +00:00

Apply URL decoding in download saver

document.location gives us an URL encoded version of the original
filename, so we decode it to recover the original filename for saving.

Fixes #2828

Fixes #2819
This commit is contained in:
Jermolene 2017-07-01 12:39:25 +01:00
parent a7b57d7f97
commit ccac0258af

View File

@ -25,7 +25,8 @@ DownloadSaver.prototype.save = function(text,method,callback,options) {
if(!filename) {
var p = document.location.pathname.lastIndexOf("/");
if(p !== -1) {
filename = document.location.pathname.substr(p+1);
// We decode the pathname because document.location is URL encoded by the browser
filename = decodeURIComponent(document.location.pathname.substr(p+1));
}
}
if(!filename) {