fix for username regex

This commit is contained in:
Kyle Drake 2024-10-03 14:22:46 -05:00
parent 5f0c590ca6
commit 372b22aa48
3 changed files with 20 additions and 1 deletions

View file

@ -683,7 +683,7 @@ class Site < Sequel::Model
end
def self.valid_username?(username)
!username.empty? && username.match(/^[a-zA-Z0-9][a-zA-Z0-9_\-]+[a-zA-Z0-9]$/i)
!username.empty? && username.match(/^[a-zA-Z0-9]([a-zA-Z0-9_\-]{0,}[a-zA-Z0-9])?$/i) != nil
end
def self.disposable_email_domains_whitelist