Fix MENTION_RE to not match nil usernames (#6862)

remotes/1727458204337373841/tmp_refs/heads/signup-info-prompt
ThibG 2018-03-22 10:45:48 +01:00 committed by Eugen Rochko
parent f66a786029
commit 6f531d140b
1 changed files with 1 additions and 1 deletions

View File

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