1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-01-08 16:41:31 +00:00

Use Redmine::MimeType.of instead of regexp to check if the attachment is Textile (#29752).

git-svn-id: http://svn.redmine.org/redmine/trunk@18586 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA 2019-10-03 09:30:43 +00:00
parent cffc5d6a12
commit 7763902629
2 changed files with 2 additions and 1 deletions

View File

@ -245,7 +245,7 @@ class Attachment < ActiveRecord::Base
end
def is_textile?
self.filename =~ /\.textile$/i
Redmine::MimeType.of(filename) == 'text/x-textile'
end
def is_image?

View File

@ -35,6 +35,7 @@ module Redmine
'text/x-ruby' => 'rb,rbw,ruby,rake,erb',
'text/x-csh' => 'csh',
'text/x-sh' => 'sh',
'text/x-textile' => 'textile',
'text/xml' => 'xml,xsd,mxml',
'text/yaml' => 'yml,yaml',
'text/csv' => 'csv',