mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: uploading an existing image as a site setting
The previous fix (f43c0a5d85) wasn't working for images that were already uploaded. The "metadata" (eg. 'for_*' and 'secure' attributes) were not added to existing uploads. Also used 'Upload.get_from_url' is the admin/site_setting controller to properly retrieve an upload from its URL. Fixed the Upload::URL_REGEX to use the \h (hexadecimal) for the SHA Follow-up-to:f43c0a5d85
This commit is contained in:
@@ -17,7 +17,7 @@ class Admin::SiteSettingsController < Admin::AdminController
|
||||
raise_access_hidden_setting(id)
|
||||
|
||||
if SiteSetting.type_supervisor.get_type(id) == :upload
|
||||
value = Upload.find_by(url: value) || ''
|
||||
value = Upload.get_from_url(value) || ""
|
||||
end
|
||||
|
||||
update_existing_users = params[:updateExistingUsers].present?
|
||||
|
||||
Reference in New Issue
Block a user