]> source.dussan.org Git - redmine.git/commitdiff
Merged r16995 (#26682).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 15 Oct 2017 11:37:25 +0000 (11:37 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 15 Oct 2017 11:37:25 +0000 (11:37 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/3.4-stable@16996 e93f8b46-1217-0410-a6f0-8f06a7374b81

public/javascripts/attachments.js

index 21ca978012388e291752a61adf11ca759954cfa1..1baafc0bdea14c14861be18e5f57f907c213044e 100644 (file)
@@ -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/)) {