Skip to content

Commit

Permalink
fix wysiwyg editor not decoding base64 filenames special chars
Browse files Browse the repository at this point in the history
  • Loading branch information
adammada committed Sep 24, 2018
1 parent ea1ace7 commit 4e62fe3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,11 @@ define([
var url = this.makeDirectiveUrl('%directive%').replace(/([$^.?*!+:=()\[\]{}|\\])/g, '\\$1'),
reg = new RegExp(url.replace('%directive%', '([a-zA-Z0-9,_-]+)'));

var uriReg = /___directive\/(.*)\/key\//g;
content = content.replace(uriReg, function (match) {
return decodeURIComponent(match);
});

return content.gsub(reg, function (match) { //eslint-disable-line no-extra-bind
return Base64.mageDecode(match[1]);
});
Expand Down

0 comments on commit 4e62fe3

Please sign in to comment.