diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-11-23 05:30:53 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-11-23 05:30:53 +0000 |
commit | 9be9c5f5658489325b0bd1068683d86d3a4d20b7 (patch) | |
tree | ecdf09defc4ff8768d36ccdeb761ed9649b7b576 /app | |
parent | 68f3e91bd7030c7ac0a33bb0bfa36b30a3645d32 (diff) | |
download | redmine-9be9c5f5658489325b0bd1068683d86d3a4d20b7.tar.gz redmine-9be9c5f5658489325b0bd1068683d86d3a4d20b7.zip |
fix inconsistent image filename extensions (#9638)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7891 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/application_helper.rb | 2 | ||||
-rw-r--r-- | app/models/attachment.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 56807adb3..9573a3291 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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 diff --git a/app/models/attachment.rb b/app/models/attachment.rb index dceb67893..c5a5187d1 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -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? |