Skip to content
Snippets Groups Projects
Commit 44574336 authored by Anusha Ranganathan's avatar Anusha Ranganathan Committed by Nils Küster
Browse files

Remove erroneous substituions from file names

parent eacec4c8
No related branches found
Tags v1.0-beta2
No related merge requests found
Pipeline #14720 passed
...@@ -51,8 +51,8 @@ module Hyrax ...@@ -51,8 +51,8 @@ module Hyrax
parsed_file = YAML.load_file(Rails.root.join('config', 'restricted_files.yml')) parsed_file = YAML.load_file(Rails.root.join('config', 'restricted_files.yml'))
file_name = file.file.original_filename 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.") errors.add(:base, "This file name is restricted.")
end end
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment