discourse/lib/tasks
Martin Brennan 4d2a95ffe6
FIX: Query UploadReference in UploadSecurity for existing uploads (#19917)
This fixes a longstanding issue for sites with the
secure_uploads setting enabled. What would happen is a scenario
like this, since we did not check all places an upload could be
linked to whenever we used UploadSecurity to check whether an
upload should be secure:

* Upload is created and used for site setting, set to secure: false
  since site setting uploads should not be secure. Let's say favicon
* Favicon for the site is used inside a post in a private category,
  e.g. via a Onebox
* We changed the secure status for the upload to true, since it's been
  used in a private category and we don't check if it's originator
  was a public place
* The site favicon breaks :'(

This was a source of constant consternation. Now, when an upload is _not_
being created, and we are checking if an existing upload should be
secure, we now check to see what the first record in the UploadReference
table is for that upload. If it's something public like a site setting,
then we will never change the upload to `secure`.
2023-01-20 10:24:52 +10:00
..
add_topic_to_quotes.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
admin.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
annotate.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
api.rake FEATURE: Hash API keys in the database (#8438) 2019-12-12 11:45:00 +00:00
assets.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
auto_annotate_models.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
autospec.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
avatars.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
backfill.thor DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
categories.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
cdn.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
db.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
destroy.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
dev.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
docker.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
emails.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
emoji.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
export.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
groups.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
hashtags.rake FEATURE: Add rake task to mark old hashtag format for rebake (#19876) 2023-01-18 10:16:05 +10:00
i18n.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
images.rake DEV: Upgrade to Rails 7 2022-04-28 11:51:03 +02:00
import.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
incoming_emails.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
integration.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
javascript.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
log.rake FIX: whoops, linting 2020-09-03 12:10:11 +01:00
maxminddb.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
plugin.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
populate.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
populate.thor DEV: Correctly tag heredocs (#16061) 2022-02-28 20:50:55 +01:00
posts.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
profile.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
qunit.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
redis.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
release_note.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
revisions.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
rspec.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
s3.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
scheduler.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
search.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
site_settings.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
site.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
smoke_test.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
svg_icons.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
tags.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
themes.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
topics.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
turbo.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
typepad.thor FIX: use allowlist and blocklist terminology (#10209) 2020-07-27 10:23:54 +10:00
uploads.rake FIX: Query UploadReference in UploadSecurity for existing uploads (#19917) 2023-01-20 10:24:52 +10:00
users.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00