FIX: Calculate email attachment size limit correctly (#11321)

When calculating whether the attached uploads went over the SiteSetting.email_total_attachment_size_limit_kb.kilobytes limit, we were using the original_upload for the calculation instead of the actually attached_upload, which will be smaller in most cases because it can be an optimized image.
This commit is contained in:
Martin Brennan
2020-11-23 11:16:08 +10:00
committed by GitHub
parent 790b9856af
commit 28db835c4c
2 changed files with 12 additions and 3 deletions

View File

@ -281,7 +281,7 @@ module Email
end
attached_upload = optimized_1X || original_upload
next if email_size + original_upload.filesize > max_email_size
next if email_size + attached_upload.filesize > max_email_size
begin
path = if attached_upload.local?