From 395615d9f3c521824f7e56f6d1bb2d82b8e421b4 Mon Sep 17 00:00:00 2001 From: ThibG Date: Tue, 27 Nov 2018 12:28:01 +0100 Subject: 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. --- app/models/account.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/models') diff --git a/app/models/account.rb b/app/models/account.rb index 46d32a36e..f25263306 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -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 -- cgit