mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 02:20:41 +08:00
bad locale files could lead to broken automatic groups
This commit is contained in:
parent
298949a343
commit
287d0dbd75
|
@ -36,6 +36,12 @@ class Group < ActiveRecord::Base
|
||||||
|
|
||||||
group.name = I18n.t("groups.default_names.#{name}")
|
group.name = I18n.t("groups.default_names.#{name}")
|
||||||
|
|
||||||
|
# don't allow shoddy localization to break this
|
||||||
|
validator = UsernameValidator.new(group.name)
|
||||||
|
unless validator.valid_format?
|
||||||
|
group.name = name
|
||||||
|
end
|
||||||
|
|
||||||
real_ids = case name
|
real_ids = case name
|
||||||
when :admins
|
when :admins
|
||||||
"SELECT u.id FROM users u WHERE u.admin"
|
"SELECT u.id FROM users u WHERE u.admin"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user