mirror of
https://github.com/redmine/redmine.git
synced 2026-04-01 18:21:12 +02:00
Merged r20862 from trunk to 4.0-stable (#34969).
git-svn-id: http://svn.redmine.org/redmine/branches/4.0-stable@20953 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
2
Gemfile
2
Gemfile
@@ -9,7 +9,7 @@ gem "request_store", "1.0.5"
|
||||
gem "mini_mime", "~> 1.0.1"
|
||||
gem "actionpack-xml_parser"
|
||||
gem "roadie-rails", "~> 1.3.0"
|
||||
gem "mimemagic"
|
||||
gem 'marcel'
|
||||
gem "mail", "~> 2.7.1"
|
||||
gem "csv", "~> 3.0.1" if RUBY_VERSION >= "2.3" && RUBY_VERSION < "2.6"
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
require 'fileutils'
|
||||
require 'mimemagic'
|
||||
|
||||
module Redmine
|
||||
module Thumbnail
|
||||
@@ -30,7 +29,7 @@ module Redmine
|
||||
return nil unless convert_available?
|
||||
unless File.exists?(target)
|
||||
# Make sure we only invoke Imagemagick if the file type is allowed
|
||||
unless File.open(source) {|f| ALLOWED_TYPES.include? MimeMagic.by_magic(f).try(:type) }
|
||||
unless File.open(source) {|f| ALLOWED_TYPES.include? Marcel::MimeType.for(f) }
|
||||
return nil
|
||||
end
|
||||
directory = File.dirname(target)
|
||||
|
||||
Reference in New Issue
Block a user