mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: empty uploads and blank filenames caused errors during validation
This commit is contained in:
@ -21,9 +21,9 @@ class UploadCreator
|
||||
# - for_private_message (boolean)
|
||||
# - pasted (boolean)
|
||||
def initialize(file, filename, opts = {})
|
||||
@upload = Upload.new
|
||||
@file = file
|
||||
@filename = filename
|
||||
@filename = filename || ''
|
||||
@upload = Upload.new(original_filename: filename, filesize: 0)
|
||||
@opts = opts
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user