Browse Source

Correctly set uuencoded attachment file size

2508-hotfix-bad-uudecode
Gareth Rees 6 years ago
parent
commit
0ad3ef57d7
  1. 3
      app/models/incoming_message.rb
  2. 1
      spec/models/incoming_message_spec.rb

3
app/models/incoming_message.rb

@ -521,8 +521,7 @@ class IncomingMessage < ActiveRecord::Base
attachment = foi_attachments.find_or_create_by_hexdigest(hexdigest)
attachment.update_attributes(:filename => filename,
:content_type => content_type,
:body => content,
:display_size => "0K")
:body => content)
attachment.save!
attachments << attachment
end

1
spec/models/incoming_message_spec.rb

@ -541,6 +541,7 @@ describe IncomingMessage, " when uudecoding bad messages" do
attachments = im.foi_attachments
attachments.size.should == 2
attachments[1].filename.should == 'ResponseT5741 15.doc'
attachments[1].display_size.should == '123K'
im.get_attachments_for_display.size.should == 1
end

Loading…
Cancel
Save