Skip to content

Commit 82d03d9

Browse files
author
Stanislav Idolov
authored
ENGCOM-3054: fix wysiwyg editor not decoding base64 filenames special chars #18215
2 parents 4557bfe + 7528fc0 commit 82d03d9

File tree

1 file changed

+6
-1
lines changed
  • lib/web/mage/adminhtml/wysiwyg/tiny_mce

1 file changed

+6
-1
lines changed

lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,12 @@ define([
461461
decodeDirectives: function (content) {
462462
// escape special chars in directives url to use it in regular expression
463463
var url = this.makeDirectiveUrl('%directive%').replace(/([$^.?*!+:=()\[\]{}|\\])/g, '\\$1'),
464-
reg = new RegExp(url.replace('%directive%', '([a-zA-Z0-9,_-]+)'));
464+
reg = new RegExp(url.replace('%directive%', '([a-zA-Z0-9,_-]+)')),
465+
uriReg = /___directive\/(.*)\/key\//g;
466+
467+
content = content.replace(uriReg, function (match) {
468+
return decodeURIComponent(match);
469+
});
465470

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

0 commit comments

Comments
 (0)