0
0
Fork 0

Allow hyphens in the middle of remote user names (#9345)

Fixes #9309

This only allows hyphens in the middle of a username, much like dots,
although I don't have a compelling reason to do so other than keeping
the changes minimal.
This commit is contained in:
ThibG 2018-11-27 12:28:01 +01:00 committed by Eugen Rochko
parent d5fac45f5b
commit 395615d9f3
2 changed files with 8 additions and 2 deletions

View file

@ -46,7 +46,7 @@
#
class Account < ApplicationRecord
USERNAME_RE = /[a-z0-9_]+([a-z0-9_\.]+[a-z0-9_]+)?/i
USERNAME_RE = /[a-z0-9_]+([a-z0-9_\.-]+[a-z0-9_]+)?/i
MENTION_RE = /(?<=^|[^\/[:word:]])@((#{USERNAME_RE})(?:@[a-z0-9\.\-]+[a-z0-9]+)?)/i
include AccountAvatar