fix inconsistent image filename extensions (#9638)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7891 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -537,7 +537,7 @@ module ApplicationHelper
|
||||
# when using an image link, try to use an attachment, if possible
|
||||
if options[:attachments] || (obj && obj.respond_to?(:attachments))
|
||||
attachments = nil
|
||||
text.gsub!(/src="([^\/"]+\.(bmp|gif|jpg|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
|
||||
attachments ||= (options[:attachments] || obj.attachments).sort_by(&:created_on).reverse
|
||||
# search for the picture in attachments
|
||||
|
||||
@@ -123,7 +123,7 @@ class Attachment < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def image?
|
||||
self.filename =~ /\.(jpe?g|gif|png)$/i
|
||||
self.filename =~ /\.(bmp|gif|jpg|jpe|jpeg|png)$/i
|
||||
end
|
||||
|
||||
def is_text?
|
||||
|
||||
Reference in New Issue
Block a user