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
This commit is contained in:
Go MAEDA
2021-04-16 01:36:59 +00:00
parent 2027b8750a
commit e41cf61de8
3 changed files with 19 additions and 7 deletions

View File

@@ -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