From eb926b7e6075b1fe5aace4d65cb7749717304b4d Mon Sep 17 00:00:00 2001 From: Emelia Smith Date: Tue, 26 Mar 2024 10:30:10 +0100 Subject: [PATCH] Ensure case-insensitive fields are converted to lowercase in user imports (#29740) --- app/models/form/import.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/models/form/import.rb b/app/models/form/import.rb index fc83d9c58c..3cc4af064f 100644 --- a/app/models/form/import.rb +++ b/app/models/form/import.rb @@ -111,12 +111,14 @@ class Form::Import csv_converter = lambda do |field, field_info| case field_info.header when 'Show boosts', 'Notify on new posts', 'Hide notifications' - ActiveModel::Type::Boolean.new.cast(field) + ActiveModel::Type::Boolean.new.cast(field&.downcase) when 'Languages' field&.split(',')&.map(&:strip)&.presence when 'Account address' field.strip.gsub(/\A@/, '') - when '#domain', '#uri', 'List name' + when '#domain' + field&.strip&.downcase + when '#uri', 'List name' field.strip else field