Skip to content

Commit ba95292

Browse files
authored
Merge pull request #3569 from DMPRoadmap/momo/add-csv-separator
Validate CSV Separator
2 parents 0c002c5 + c545f6d commit ba95292

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## v5.0.2
44
- Bump Ruby to v3.1.4 and use `.ruby-version` in CI [#3566](https://github.com/DMPRoadmap/roadmap/pull/3566)
55
- Enable session timeout after 90 minutes of inactivity [#3568](https://github.com/DMPRoadmap/roadmap/pull/3568)
6+
- Validate CSV Separator [#3569](https://github.com/DMPRoadmap/roadmap/pull/3569)
67

78
## v5.0.1
89
- Updated seeds.rb file for identifier_schemes to include context value and removed logo_url and idenitifier_prefix for Shibboleth (as it was causing issues with SSO). [#3525](https://github.com/DMPRoadmap/roadmap/pull/3525)

app/controllers/usage_controller.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,14 @@ def parse_filtered
151151
params[:filtered].present? && params[:filtered] == 'true'
152152
end
153153

154-
# set the csv separator or default to comma
154+
# This sets the csv separator
155+
# Ensures separator is either a comma or a safe separator
155156
def sep_param
156-
params['sep'] || ','
157+
safe_csv_separators = Rails.configuration.x.application.csv_separators
158+
sep = params['sep'].to_s
159+
return sep if safe_csv_separators.include?(sep)
160+
161+
','
157162
end
158163

159164
def min_max_dates(args:)

0 commit comments

Comments
 (0)