From a3e8b7825056f41617cd469d0fe469d69056953f Mon Sep 17 00:00:00 2001 From: Emelia Smith Date: Tue, 26 Mar 2024 10:30:07 +0100 Subject: [PATCH] Ensure case-insensitive fields are converted to lowercase in Admin Imports (#29739) --- app/models/admin/import.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/models/admin/import.rb b/app/models/admin/import.rb index 0fd4bdb82..c12c9a86b 100644 --- a/app/models/admin/import.rb +++ b/app/models/admin/import.rb @@ -30,12 +30,14 @@ class Admin::Import csv_converter = lambda do |field, field_info| case field_info.header - when '#domain', '#public_comment' + when '#domain' + field&.downcase&.strip + when '#public_comment' field&.strip when '#severity' - field&.strip&.to_sym + field&.downcase&.strip&.to_sym when '#reject_media', '#reject_reports', '#obfuscate' - ActiveModel::Type::Boolean.new.cast(field) + ActiveModel::Type::Boolean.new.cast(field&.downcase) else field end