0
0
Fork 0

Fix processing of media files with unusual names (#25788)

This commit is contained in:
Claire 2023-07-07 13:35:22 +02:00 committed by GitHub
parent 5e1752ce3f
commit 94fbac77e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 1 deletions

View file

@ -24,7 +24,7 @@ module Attachmentable
def self.has_attached_file(name, options = {}) # rubocop:disable Naming/PredicateName
super(name, options)
send(:"before_#{name}_validate") do
send(:"before_#{name}_validate", prepend: true) do
attachment = send(name)
check_image_dimension(attachment)
set_file_content_type(attachment)