From 335982325e32430858da8112cb86e382e1eaeaa2 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 3 Oct 2023 11:01:45 -0400 Subject: [PATCH] Dont match mention in url query string (#25656) Co-authored-by: Claire --- app/models/account.rb | 6 +++--- spec/models/account_spec.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/account.rb b/app/models/account.rb index 2fbed7801..31d3fa69c 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -61,9 +61,9 @@ class Account < ApplicationRecord trust_level ) - USERNAME_RE = /[a-z0-9_]+([a-z0-9_\.-]+[a-z0-9_]+)?/i - MENTION_RE = /(?<=^|[^\/[:word:]])@((#{USERNAME_RE})(?:@[[:word:]\.\-]+[[:word:]]+)?)/i - URL_PREFIX_RE = /\Ahttp(s?):\/\/[^\/]+/ + USERNAME_RE = /[a-z0-9_]+([a-z0-9_.-]+[a-z0-9_]+)?/i + MENTION_RE = %r{(?