]> cat aescling's git repositories - mastodon.git/commitdiff
Fix error when searching for URLs that contain the mention syntax (#13151)
authorThibG <thib@sitedethib.com>
Sun, 8 Mar 2020 14:42:20 +0000 (15:42 +0100)
committerGitHub <noreply@github.com>
Sun, 8 Mar 2020 14:42:20 +0000 (15:42 +0100)
Fixes #13150

app/services/account_search_service.rb

index d217dabb37f4857a692e4cb6c277091ba2b47ec8..493813aab4e1c6b465da3a344a6fd17aee169636 100644 (file)
@@ -171,7 +171,7 @@ class AccountSearchService < BaseService
   end
 
   def username_complete?
-    query.include?('@') && "@#{query}" =~ Account::MENTION_RE
+    query.include?('@') && "@#{query}" =~ /\A#{Account::MENTION_RE}\Z/
   end
 
   def likely_acct?