mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 12:47:58 +08:00
FEATURE: Treat site settings as plain text and add a new HTML type. (#12618)
To add an extra layer of security, we sanitize settings before shipping them to the client. We don't sanitize those that have the "html" type. The CookedPostProcessor already uses Loofah for sanitization, so I chose to also use it for this. I added it to our gemfile since we installed it as a transitive dependency.
This commit is contained in:
@ -6,7 +6,10 @@ class Admin::SiteSettingsController < Admin::AdminController
|
||||
end
|
||||
|
||||
def index
|
||||
render_json_dump(site_settings: SiteSetting.all_settings, diags: SiteSetting.diags)
|
||||
render_json_dump(
|
||||
site_settings: SiteSetting.all_settings(sanitize_plain_text_settings: true),
|
||||
diags: SiteSetting.diags
|
||||
)
|
||||
end
|
||||
|
||||
def update
|
||||
|
Reference in New Issue
Block a user