lib/carrierwave/base64/base64_string_io.rb in carrierwave-base64-2.6.0 vs lib/carrierwave/base64/base64_string_io.rb in carrierwave-base64-2.6.1
- old
+ new
@@ -4,12 +4,15 @@
attr_accessor :file_extension, :file_name
def initialize(encoded_file, file_name)
description, encoded_bytes = encoded_file.split(',')
+ raise ArgumentError unless encoded_bytes
+ raise ArgumentError if encoded_bytes.eql?('(null)')
+
@file_name = file_name
@file_extension = get_file_extension description
- bytes = ::Base64.strict_decode64 encoded_bytes
+ bytes = ::Base64.decode64 encoded_bytes
super bytes
end
def original_filename