Skip to content

Commit

Permalink
Merged in r2-2887-bulk-export-name (pull request #6901)
Browse files Browse the repository at this point in the history
R2-2887: Sanitizing user defined filename for bulk exports
  • Loading branch information
jtoliver-quoin authored and pnabutovsky committed Aug 16, 2024
2 parents 2d3f185 + dab370d commit 831e9c8
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 831e9c8

Please sign in to comment.