If a community name has a < or > it may cause havoc when the community attempts to send an email. Closes #15274
25 lines
835 B
Ruby
25 lines
835 B
Ruby
module Settings
|
|
class Community < Base
|
|
self.table_name = :settings_communities
|
|
|
|
setting :copyright_start_year,
|
|
type: :integer,
|
|
default: ApplicationConfig["COMMUNITY_COPYRIGHT_START_YEAR"] || Time.zone.today.year
|
|
setting :community_description, type: :string
|
|
setting :community_emoji, type: :string, default: "🌱", validates: { emoji_only: true }
|
|
setting(
|
|
:community_name,
|
|
type: :string,
|
|
default: ApplicationConfig["COMMUNITY_NAME"] || "New Forem",
|
|
validates: {
|
|
format: {
|
|
with: /\A[^[<|>]]+\Z/,
|
|
message: "may not include the \"<\" nor \">\" character"
|
|
}
|
|
},
|
|
)
|
|
setting :member_label, type: :string, default: "user"
|
|
setting :staff_user_id, type: :integer, default: 1
|
|
setting :tagline, type: :string
|
|
end
|
|
end
|