summaryrefslogtreecommitdiffstats
path: root/lib/redmine/wiki_formatting.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2018-06-17 05:57:39 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2018-06-17 05:57:39 +0000
commitb1b89ff0ac854d88bff6409fda784191060b18d3 (patch)
tree9140c0af97f381a88a0b88c5802a0e8c4bd8d432 /lib/redmine/wiki_formatting.rb
parent270b6c4d7eef3fcc38657ad411553da47a2e958b (diff)
downloadredmine-b1b89ff0ac854d88bff6409fda784191060b18d3.tar.gz
redmine-b1b89ff0ac854d88bff6409fda784191060b18d3.zip
"attachment:filename" link syntax would not work if the file name contains "@" (#26507).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@17393 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/wiki_formatting.rb')
-rw-r--r--lib/redmine/wiki_formatting.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/redmine/wiki_formatting.rb b/lib/redmine/wiki_formatting.rb
index 9a2de5cff..412d0f434 100644
--- a/lib/redmine/wiki_formatting.rb
+++ b/lib/redmine/wiki_formatting.rb
@@ -180,6 +180,10 @@ module Redmine
html.gsub!(%r{\buser:<a(\sclass="email")? href="mailto:(.*?)">(.*?)<\/a>}) do
"user:#{$2}"
end
+ # restore attachments links with @ in file name eg. [attachment:image@2x.png]
+ html.gsub!(%r{\battachment:<a(\sclass="email")? href="mailto:(.*?)">(.*?)</a>}) do
+ "attachment:#{$2}"
+ end
html
end
end