1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-19 15:01:14 +00:00

Attachments with Unicode uppercase names are not shown in wiki pages (#30441).

Patch by Evgeny Seliverstov.


git-svn-id: http://svn.redmine.org/redmine/trunk@18057 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA 2019-04-12 05:25:31 +00:00
parent e597650897
commit 51b0542e7d

View File

@ -774,7 +774,7 @@ module ApplicationHelper
attachments += obj.attachments if obj.respond_to?(:attachments) attachments += obj.attachments if obj.respond_to?(:attachments)
if attachments.present? if attachments.present?
text.gsub!(/src="([^\/"]+\.(bmp|gif|jpg|jpe|jpeg|png))"(\s+alt="([^"]*)")?/i) do |m| text.gsub!(/src="([^\/"]+\.(bmp|gif|jpg|jpe|jpeg|png))"(\s+alt="([^"]*)")?/i) do |m|
filename, ext, alt, alttext = $1.downcase, $2, $3, $4 filename, ext, alt, alttext = $1, $2, $3, $4
# search for the picture in attachments # search for the picture in attachments
if found = Attachment.latest_attach(attachments, CGI.unescape(filename)) if found = Attachment.latest_attach(attachments, CGI.unescape(filename))
image_url = download_named_attachment_url(found, found.filename, :only_path => only_path) image_url = download_named_attachment_url(found, found.filename, :only_path => only_path)