Skip to content

Commit

Permalink
R2-2887: Sanitizing user defined filename for bulk exports
Browse files Browse the repository at this point in the history
  • Loading branch information
jtoliver-quoin committed Aug 15, 2024
1 parent 53e3372 commit dab370d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/bulk_export.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def archive!
end

def generate_file_name
return if file_name.present?
return self.file_name = ActiveStorage::Filename.new(file_name).sanitized if file_name.present?

self.file_name = "#{record_type&.pluralize}-#{Time.now.strftime('%Y%m%d.%M%S%M%L')}.#{exporter_type&.mime_type}"
end
Expand Down

0 comments on commit dab370d

Please sign in to comment.