From: aescling Date: Mon, 5 Sep 2022 01:04:13 +0000 (-0400) Subject: Update ACCOUNT_STRING_RE to match MENTION_RE X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=e846ec516e26f5938004f8bfdf0b98944930103e;p=mastodon.git Update ACCOUNT_STRING_RE to match MENTION_RE See https://gitlab.com/kibicat/mastodon/-/issues/13 --- diff --git a/app/models/concerns/account_finder_concern.rb b/app/models/concerns/account_finder_concern.rb index c4f255b73..0318060c9 100644 --- a/app/models/concerns/account_finder_concern.rb +++ b/app/models/concerns/account_finder_concern.rb @@ -50,7 +50,7 @@ module AccountFinderConcern # + not match if there is anything surrounding the mention, and # + add named subgroup matches # it would be ideal to explicitly refer to MENTION_RE, or a more fundamental regexp that we refactor MENTION_RE to incorporate - ACCOUNT_STRING_RE = /^@?(?#{Account::USERNAME_RE})(?:@(?[[:word:]\.\-]+[[:word:]]+))?$/i + ACCOUNT_STRING_RE = /^@?(?#{Account::USERNAME_RE})(?:@(?[[:alnum:]\.\-]+[[:alnum:]]+))?$/i class AccountFinder attr_reader :username, :domain