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 @@
Click or drag and drop to upload a file
-
Max size: <%= number_to_human_size(Danbooru.config.max_file_size) %>. Supported filetypes: jpg, png, gif, swf, mp4, webm.
+
Max size: <%= number_to_human_size(Danbooru.config.max_file_size) %>. Supported filetypes: jpg, png, gif, mp4, webm.
diff --git a/test/functional/uploads_controller_test.rb b/test/functional/uploads_controller_test.rb index e60ba4e0d..77bc57388 100644 --- a/test/functional/uploads_controller_test.rb +++ b/test/functional/uploads_controller_test.rb @@ -287,7 +287,7 @@ class UploadsControllerTest < ActionDispatch::IntegrationTest should_upload_successfully("test/files/test-animated-86x52.gif") should_upload_successfully("test/files/test-300x300.mp4") should_upload_successfully("test/files/test-512x512.webm") - should_upload_successfully("test/files/compressed.swf") + # should_upload_successfully("test/files/compressed.swf") end context "uploading a file from a source" do