A platform for community discussion. Free, open, simple.
FIX: Do not allow_any on fonts site_settings (#30780)
Martin Brennan125e686bf21e
diff --git a/config/site_settings.yml b/config/site_settings.ymlindex 02cd5adad83..fa051214f40 100644--- a/config/site_settings.yml+++ b/config/site_settings.yml@@ -414,6 +414,7 @@ basic:type: listlist_type: fontarea: "fonts"+ allow_any: falseheading_font:default: "arial"choices: "BaseFontSetting.values"@@ -421,6 +422,7 @@ basic:type: listlist_type: fontarea: "fonts"+ allow_any: falseenable_sitemap:default: truesitemap_page_size:diff --git a/lib/site_settings/type_supervisor.rb b/lib/site_settings/type_supervisor.rbindex 5d2a458ef1e..bee07602d17 100644--- a/lib/site_settings/type_supervisor.rb+++ b/lib/site_settings/type_supervisor.rb@@ -269,7 +269,11 @@ class SiteSettings::TypeSupervisorif type == self.class.types[:list] || type == self.class.types[:string]if @allow_any.key?(name) && !@allow_any[name]split = val.to_s.split("|")- diff = (split - @choices[name])+ resolved_choices = @choices[name]+ if resolved_choices.first.is_a?(Hash)+ resolved_choices = resolved_choices.map { |c| c[:value] }+ end+ diff = (split - resolved_choices)if diff.length > 0raise Discourse::InvalidParameters.new(I18n.t(