diff --git a/hyrax/app/models/hyrax/uploaded_file.rb b/hyrax/app/models/hyrax/uploaded_file.rb index 24187e798a55014b9c6dad5caadaecb3df0a0a61..2d1f25c6de29d1df500114df1c849ced61b1a0bc 100644 --- a/hyrax/app/models/hyrax/uploaded_file.rb +++ b/hyrax/app/models/hyrax/uploaded_file.rb @@ -51,8 +51,8 @@ module Hyrax parsed_file = YAML.load_file(Rails.root.join('config', 'restricted_files.yml')) file_name = file.file.original_filename - - if parsed_file['restricted_file_names'].include?(file_name.gsub(/[\s_\-]/, '').downcase) + + if parsed_file['restricted_file_names'].include?(file_name) || parsed_file['restricted_file_names'].include?(file_name.downcase) errors.add(:base, "This file name is restricted.") end end