diff --git a/app/models/upload.rb b/app/models/upload.rb index cfe822956..ff3bbbba5 100644 --- a/app/models/upload.rb +++ b/app/models/upload.rb @@ -13,8 +13,8 @@ class Upload < ApplicationRecord end def validate_file_ext(record) - if record.file_ext == "bin" - record.errors.add(:file_ext, "is invalid (only JPEG, PNG, GIF, SWF, MP4, and WebM files are allowed") + if record.file_ext.in?(["bin", "swf"]) + record.errors.add(:file_ext, "is invalid (only JPEG, PNG, GIF, MP4, and WebM files are allowed") end end diff --git a/app/views/uploads/new.html.erb b/app/views/uploads/new.html.erb index 9b2b9ae1b..7d50b9a70 100644 --- a/app/views/uploads/new.html.erb +++ b/app/views/uploads/new.html.erb @@ -31,7 +31,7 @@