about summary refs log tree commit diff
path: root/lib/paperclip/transcoder.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2023-07-06 15:05:05 +0200
committerStarfall <us@starfall.systems>2023-07-07 11:45:48 -0500
commitc58ab80b976410b51bc5520b00a98dcdc256dee3 (patch)
tree30f37474642eb7d8120c82b6dd534fb43806d5df /lib/paperclip/transcoder.rb
parent5ddae512857eb143ff91741f4a35c186fac1036e (diff)
Merge pull request from GHSA-9928-3cp5-93fm
* Fix attachments getting processed despite failing content-type validation

* Add a restrictive ImageMagick security policy tailored for Mastodon

* Fix misdetection of MP3 files with large cover art

* Reject unprocessable audio/video files instead of keeping them unchanged
Diffstat (limited to 'lib/paperclip/transcoder.rb')
-rw-r--r--lib/paperclip/transcoder.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/paperclip/transcoder.rb b/lib/paperclip/transcoder.rb
index b3b55f82f..f4768aa60 100644
--- a/lib/paperclip/transcoder.rb
+++ b/lib/paperclip/transcoder.rb
@@ -19,10 +19,7 @@ module Paperclip
     def make
       metadata = VideoMetadataExtractor.new(@file.path)
 
-      unless metadata.valid?
-        Paperclip.log("Unsupported file #{@file.path}")
-        return File.open(@file.path)
-      end
+      raise Paperclip::Error, "Error while transcoding #{@file.path}: unsupported file" unless metadata.valid?
 
       update_attachment_type(metadata)
       update_options_from_metadata(metadata)