mirror of
https://github.com/nextcloud/passman.git
synced 2025-12-11 06:05:51 +08:00
fix file download from credential view
This commit is contained in:
parent
7065a60686
commit
a361f31022
3 changed files with 13 additions and 4 deletions
|
|
@ -58,7 +58,7 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var file_data = EncryptService.decryptString(result.file_data, _key);
|
var file_data = EncryptService.decryptString(result.file_data, _key);
|
||||||
download(file_data, escapeHTML(file.filename), file.mimetype);
|
download(file_data, ShareService.escapeHTML(file.filename), file.mimetype);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}]);
|
}]);
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
var file_data = EncryptService.decryptString(result.file_data, key);
|
var file_data = EncryptService.decryptString(result.file_data, key);
|
||||||
download(file_data, escapeHTML(file.filename), file.mimetype);
|
download(file_data, ShareService.escapeHTML(file.filename), file.mimetype);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -65,4 +65,4 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}]);
|
}]);
|
||||||
}());
|
}());
|
||||||
|
|
|
||||||
|
|
@ -310,7 +310,16 @@
|
||||||
|
|
||||||
setTimeout(workload.bind(this), 0);
|
setTimeout(workload.bind(this), 0);
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sanitizes a HTML string by replacing all potential dangerous characters with HTML entities
|
||||||
|
* @param {string} s String to sanitize
|
||||||
|
* @return {string} Sanitized string
|
||||||
|
*/
|
||||||
|
escapeHTML: function (s) {
|
||||||
|
return s.toString().split('&').join('&').split('<').join('<').split('>').join('>').split('"').join('"').split('\'').join(''');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}]);
|
}]);
|
||||||
}());
|
}());
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue