mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
SECURITY: disable user entered badge SQL by default
- Hidden site settings now must be change via rails console
This commit is contained in:
@ -10,6 +10,10 @@ class Admin::SiteSettingsController < Admin::AdminController
|
||||
value = params[id]
|
||||
value.strip! if value.is_a?(String)
|
||||
begin
|
||||
# note, as of Ruby 2.3 symbols are GC'd so this is considered safe
|
||||
if SiteSetting.hidden_settings.include?(id.to_sym)
|
||||
raise Discourse::InvalidParameters, "You are not allowed to change hidden settings"
|
||||
end
|
||||
SiteSetting.set_and_log(id, value, current_user)
|
||||
render nothing: true
|
||||
rescue Discourse::InvalidParameters => e
|
||||
|
Reference in New Issue
Block a user