Switch from unmaintained paperclip to kt-paperclip (#16724)
* Switch from unmaintained paperclip to kt-paperclip * Drop some compatibility monkey-patches not required by kt-paperclip * Drop media spoof check monkey-patching It's broken with kt-paperclip and hopefully it won't be needed anymore * Fix regression introduced by paperclip 6.1.0 * Do not rely on pathname to call FastImage * Add test for ogg vorbis file with cover art * Add audio/vorbis to the accepted content-types This seems erroneous as this would be the content-type for a vorbis stream without an ogg container, but that's what the `marcel` gem outputs, so… * Restore missing for_as_default method * Refactor Attachmentable concern and delay Paperclip's content-type spoof check Check for content-type spoofing *after* setting the extension ourselves, this fixes a regression with kt-paperclip's validations being more strict than paperclip 6.0.0 and rejecting some Pleroma uploads because of unknown extensions. * Please CodeClimate * Add audio/vorbis to the unreliable set It doesn't correspond to a file format and thus has no extension associated.
Showing
- Gemfile 1 addition, 1 deletionGemfile
- Gemfile.lock 7 additions, 10 deletionsGemfile.lock
- app/lib/fast_geometry_parser.rb 1 addition, 1 deletionapp/lib/fast_geometry_parser.rb
- app/models/account.rb 1 addition, 1 deletionapp/models/account.rb
- app/models/concerns/attachmentable.rb 27 additions, 34 deletionsapp/models/concerns/attachmentable.rb
- app/models/custom_emoji.rb 3 additions, 3 deletionsapp/models/custom_emoji.rb
- app/models/media_attachment.rb 3 additions, 3 deletionsapp/models/media_attachment.rb
- app/models/preview_card.rb 3 additions, 3 deletionsapp/models/preview_card.rb
- config/application.rb 0 additions, 3 deletionsconfig/application.rb
- lib/paperclip/attachment_extensions.rb 29 additions, 0 deletionslib/paperclip/attachment_extensions.rb
- lib/paperclip/media_type_spoof_detector_extensions.rb 0 additions, 35 deletionslib/paperclip/media_type_spoof_detector_extensions.rb
- lib/paperclip/schema_extensions.rb 0 additions, 37 deletionslib/paperclip/schema_extensions.rb
- lib/paperclip/url_generator_extensions.rb 0 additions, 10 deletionslib/paperclip/url_generator_extensions.rb
- lib/paperclip/validation_extensions.rb 0 additions, 58 deletionslib/paperclip/validation_extensions.rb
- spec/fixtures/files/boop.ogg 0 additions, 0 deletionsspec/fixtures/files/boop.ogg
- spec/models/media_attachment_spec.rb 24 additions, 0 deletionsspec/models/media_attachment_spec.rb
Loading
Please register or sign in to comment