mirror of
https://github.com/discourse/discourse.git
synced 2025-03-27 22:56:06 +08:00

When a user creates or edits a post, we already were updating the security of uploads in the post based on site settings and their access control post, which is important since these uploads may be switched from secure/not secure based on configuration. The `with_secure_uploads?` method on a post is used to determine whether to use the secure-uploads URL for all uploads in the post, regardless of their individual security, so if this is false and some of the posts are still secure when rebaking, we end up with broken URLs. This commit just makes it so rebaking via the UI also re-evaluates upload security so that when the post is loaded again after processing, all of the uploads have the correct security.