mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Correctly sanitize negative integers in site settings (#24170)
As part of #23816, which sought to strip out thousand separators, we also accidentally strip out signs. This is making it impossible to disable some settings which require a -1 to disable. Instead of stripping non-digits, strip anything that isn't a sign or a digit.
This commit is contained in:
@@ -33,7 +33,7 @@ class Admin::SiteSettingsController < Admin::AdminController
|
||||
|
||||
case SiteSetting.type_supervisor.get_type(id)
|
||||
when :integer
|
||||
value = value.gsub(/\D/, "")
|
||||
value = value.tr("^-0-9", "")
|
||||
when :uploaded_image_list
|
||||
value = Upload.get_from_urls(value.split("|")).to_a
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user