mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-09-27 06:38:19 +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:
parent
a7b57d7f97
commit
ccac0258af
@ -25,7 +25,8 @@ DownloadSaver.prototype.save = function(text,method,callback,options) {
|
|||||||
if(!filename) {
|
if(!filename) {
|
||||||
var p = document.location.pathname.lastIndexOf("/");
|
var p = document.location.pathname.lastIndexOf("/");
|
||||||
if(p !== -1) {
|
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) {
|
if(!filename) {
|
||||||
|
Loading…
Reference in New Issue
Block a user