mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 15:48:43 -05:00
bad locale files could lead to broken automatic groups
This commit is contained in:
parent
298949a343
commit
287d0dbd75
1 changed files with 6 additions and 0 deletions
|
@ -36,6 +36,12 @@ class Group < ActiveRecord::Base
|
|||
|
||||
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
|
||||
when :admins
|
||||
"SELECT u.id FROM users u WHERE u.admin"
|
||||
|
|
Loading…
Reference in a new issue