URL-escape the ! character in generated markup for dropped uploads
|Assignee:||Jean-Philippe Lang||% Done:|
In #26071, we introduced the ability to just drag an image into a textbox and have Redmine generate the correct image markup for the uploaded file for easy inclusion.
! character in the filename is not escaped here. Thus, when using Textile as the markup language and if the filename of the dropped file contains a
! character, the resulting markup will be invalid and the image will not be correctly referenced in the generated HTML.
The attached patch fixes this by explicitly percent-escaping the exclamation mark. While this step is not strictly required for markdown, it doesn't hurt there since the escaped version is strictly equivalent to the unescaped one for URLs.
URL-escape additional characters with special meaning in the generated markup for dropped uploads (#26682).
Patch by Holger Just.
#3 Updated by Holger Just over 1 year ago
Thank you for the review Maeda-san. I had a look at the Markdown generation but completely missed the parenthesis. In addition to that, it turns out that in my previous patch, only the first instance of an exclamation mark would have been escaped
The attached patch fixes both of these issues. It completely supersedes the previous patch.