From b539515f5624950f3faef691e0c91575f4d054e6 Mon Sep 17 00:00:00 2001 From: Holger Just Date: Mon, 14 Aug 2017 15:21:33 +0200 Subject: [PATCH] URL-escape the ! character in generated markup for dropped uploads --- public/javascripts/attachments.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js index 21ca97801..b6479b212 100644 --- a/public/javascripts/attachments.js +++ b/public/javascripts/attachments.js @@ -214,7 +214,7 @@ 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('!', '%21'); var newLineBefore = true; var newLineAfter = true; if(cursorPosition === 0 || description.substr(cursorPosition-1,1).match(/\r|\n/)) { -- 2.13.0