mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 19:43:44 +08:00
154afa60eb
When changing upload security using `Upload#update_secure_status`, we may not have the context of how an upload is being created, because this code path can be run through scheduled jobs. When calling update_secure_status, the normal ActiveRecord validations are run, and ours include validating extensions. In some cases the upload is created in an automated way, such as user export zips, and the security is applied later, with the extension prohibited from use when normally uploading. This caused the upload to fail validation on `update_secure_status`, causing the security change to silently fail. This fixes the issue by skipping the file extension validation when the upload security is being changed. |
||
---|---|---|
.. | ||
bulk_user_title_update_spec.rb | ||
group_smtp_email_spec.rb | ||
update_post_uploads_secure_status_spec.rb |