]> cat aescling's git repositories - mastodon.git/commitdiff
Update ACCOUNT_STRING_RE to match MENTION_RE
authoraescling <aescling+gitlab@cat.family>
Mon, 5 Sep 2022 01:04:13 +0000 (21:04 -0400)
committeraescling <aescling+gitlab@cat.family>
Mon, 5 Sep 2022 04:28:03 +0000 (00:28 -0400)
See https://gitlab.com/kibicat/mastodon/-/issues/13

app/models/concerns/account_finder_concern.rb

index c4f255b73b08238c10c257aa47b3db3962232eb2..0318060c9d6c4e289120656a998568d83bbb270f 100644 (file)
@@ -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 = /^@?(?<username>#{Account::USERNAME_RE})(?:@(?<domain>[[:word:]\.\-]+[[:word:]]+))?$/i
+  ACCOUNT_STRING_RE = /^@?(?<username>#{Account::USERNAME_RE})(?:@(?<domain>[[:alnum:]\.\-]+[[:alnum:]]+))?$/i
 
   class AccountFinder
     attr_reader :username, :domain