Browse Source

URL-escape additional characters with special meaning in the generated markup for dropped uploads (#26682).

Patch by Holger Just.

git-svn-id: http://svn.redmine.org/redmine/trunk@16995 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/4.0.0
Jean-Philippe Lang 6 years ago
parent
commit
738bb449ef
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      public/javascripts/attachments.js

+ 2
- 1
public/javascripts/attachments.js View 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/)) {

Loading…
Cancel
Save