summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2021-04-16 01:36:59 +0000
committerGo MAEDA <maeda@farend.jp>2021-04-16 01:36:59 +0000
commite41cf61de80bb183abeae8c1674cb7d0ef9d1277 (patch)
tree7048ac258cd3c7990c8b541f72a3efd600807e94 /lib
parent2027b8750aa8f6432cf58fc5b0f8bf15ef8a03d8 (diff)
downloadredmine-e41cf61de80bb183abeae8c1674cb7d0ef9d1277.tar.gz
redmine-e41cf61de80bb183abeae8c1674cb7d0ef9d1277.zip
Validate attachment filenames on every change (#34367).
Patch by Holger Just. git-svn-id: http://svn.redmine.org/redmine/trunk@20946 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb2
1 files changed, 1 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 32ab675c7..9cd76388b 100644
--- a/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb
+++ b/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb
@@ -107,7 +107,7 @@ module Redmine
end
next unless a
a.description = attachment['description'].to_s.strip
- if a.new_record?
+ if a.new_record? || a.invalid?
unsaved_attachments << a
else
saved_attachments << a