Fix base64-encoded file uploads not being possible (#12748)

Fix #3804, Fix #5776
This commit is contained in:
Eugen Rochko
2020-01-04 01:54:07 +01:00
committed by GitHub
parent 500276c99b
commit 49b2f7c0a2
14 changed files with 80 additions and 62 deletions

View File

@ -1,16 +0,0 @@
# frozen_string_literal: true
module ObfuscateFilename
extend ActiveSupport::Concern
class_methods do
def obfuscate_filename(path)
before_action do
file = params.dig(*path)
next if file.nil?
file.original_filename = SecureRandom.hex(8) + File.extname(file.original_filename)
end
end
end
end