Project

General

Profile

Patch #26682 » 0001-URL-escape-additional-characters-with-special-meanin.patch

Holger Just, 2017-08-15 12:11

View differences:

public/javascripts/attachments.js
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/)) {
(5-5/5)