summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-02-28 18:05:17 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-02-28 18:05:17 +0000
commitdac7903da3abb64309b5bf12ce36892b393cb9af (patch)
tree49690d33d31ddc420b705acf6cde63bd61094d14 /lib
parentdcc216002d6b2587f4aef4f628e82d8a970395df (diff)
downloadredmine-dac7903da3abb64309b5bf12ce36892b393cb9af.tar.gz
redmine-dac7903da3abb64309b5bf12ce36892b393cb9af.zip
Fixes uploading of empty files (#25115).
- prevents creation of attachment records without existing diskfile and empty digest - adds test case to check file upload API response - also removes the file size check in ActsAsAttachable which still prevented attachment of zero size attachments to containers but only for clients without Javascript (where save_attachments is called with the actual file upload). Patch by Jens Kraemer. git-svn-id: http://svn.redmine.org/redmine/trunk@16341 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb1
1 files changed, 0 insertions, 1 deletions
diff --git a/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb b/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb
index 2e5fc841c..45fa72b2d 100644
--- a/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb
+++ b/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb
@@ -89,7 +89,6 @@ module Redmine
next unless attachment.is_a?(Hash)
a = nil
if file = attachment['file']
- next unless file.size > 0
a = Attachment.create(:file => file, :author => author)
elsif token = attachment['token'].presence
a = Attachment.find_by_token(token)