From: Claire Date: Thu, 15 Jun 2023 15:35:00 +0000 (+0200) Subject: Reject unprocessable audio/video files instead of keeping them unchanged X-Git-Url: https://awoo.directory/?a=commitdiff_plain;h=78932069e6d559b39de9de308d7042d2d6a04329;p=mastodon.git Reject unprocessable audio/video files instead of keeping them unchanged Signed-off-by: Claire --- 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)