mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 15:54:43 +08:00
replace the upload type whitelist with a sanitizer
This commit is contained in:
@ -21,9 +21,6 @@ class Upload < ActiveRecord::Base
|
||||
|
||||
validates_with ::Validators::UploadValidator
|
||||
|
||||
CROPPED_TYPES ||= %w{avatar card_background custom_emoji profile_background}.each(&:freeze)
|
||||
UPLOAD_TYPES ||= CROPPED_TYPES + %w{composer category_logo category_background wizard_logo_url wizard_logo_small_url wizard_favicon_url wizard_apple_touch_icon_url}.each(&:freeze)
|
||||
|
||||
def thumbnail(width = self.width, height = self.height)
|
||||
optimized_images.find_by(width: width, height: height)
|
||||
end
|
||||
|
Reference in New Issue
Block a user