From e41cf61de80bb183abeae8c1674cb7d0ef9d1277 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Fri, 16 Apr 2021 01:36:59 +0000 Subject: 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 --- lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') 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 -- cgit v1.2.3