mirror of
https://github.com/wekan/wekan.git
synced 2025-12-19 08:50:13 +01:00
Fixed Non-ASCII attachment filename will crash when downloading.
Thanks to xet7 ! Fixes #2759
This commit is contained in:
parent
843ff8eaaa
commit
c2da477735
277 changed files with 30568 additions and 52 deletions
14
packages/wekan-cfs-data-man/server/data-man-datauri.js
Normal file
14
packages/wekan-cfs-data-man/server/data-man-datauri.js
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/**
|
||||
* @method DataMan.DataURI
|
||||
* @public
|
||||
* @constructor
|
||||
* @param {String} dataUri
|
||||
*/
|
||||
DataMan.DataURI = function DataManDataURI(dataUri) {
|
||||
var self = this;
|
||||
var pieces = dataUri.match(/^data:(.*);base64,(.*)$/);
|
||||
var buffer = new Buffer(pieces[2], 'base64');
|
||||
return new DataMan.Buffer(buffer, pieces[1]);
|
||||
};
|
||||
|
||||
DataMan.DataURI.prototype = DataMan.Buffer.prototype;
|
||||
Loading…
Add table
Add a link
Reference in a new issue