summaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-10-15 11:37:25 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-10-15 11:37:25 +0000
commite3fafdb6aa737ab83760698671e9c91271da27d3 (patch)
tree263fa0988a279032a2dd9755bdceb052061d02af /public
parent12acf15df61eeb3abff66537827debd5e16ca320 (diff)
downloadredmine-e3fafdb6aa737ab83760698671e9c91271da27d3.tar.gz
redmine-e3fafdb6aa737ab83760698671e9c91271da27d3.zip
Merged r16995 (#26682).
git-svn-id: http://svn.redmine.org/redmine/branches/3.4-stable@16996 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'public')
-rw-r--r--public/javascripts/attachments.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js
index 21ca97801..1baafc0bd 100644
--- a/public/javascripts/attachments.js
+++ b/public/javascripts/attachments.js
@@ -214,7 +214,8 @@ function addInlineAttachmentMarkup(file) {
var cursorPosition = $textarea.prop('selectionStart');
var description = $textarea.val();
var sanitizedFilename = file.name.replace(/[\/\?\%\*\:\|\"\'<>\n\r]+/, '_');
- var inlineFilename = encodeURIComponent(sanitizedFilename);
+ var inlineFilename = encodeURIComponent(sanitizedFilename)
+ .replace(/[!()]/g, function(match) { return "%" + match.charCodeAt(0).toString(16) });
var newLineBefore = true;
var newLineAfter = true;
if(cursorPosition === 0 || description.substr(cursorPosition-1,1).match(/\r|\n/)) {