mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 02:22:40 +08:00
FEATURE: Add support for Unicode usernames and group names
Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
This commit is contained in:
13
lib/validators/unicode_username_validator.rb
Normal file
13
lib/validators/unicode_username_validator.rb
Normal file
@ -0,0 +1,13 @@
|
||||
class UnicodeUsernameValidator
|
||||
def initialize(opts = {})
|
||||
@opts = opts
|
||||
end
|
||||
|
||||
def valid_value?(value)
|
||||
@valid = SiteSetting.external_system_avatars_enabled || value == "f"
|
||||
end
|
||||
|
||||
def error_message
|
||||
I18n.t("site_settings.errors.unicode_usernames_avatars") if !@valid
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user