logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe
commit: 6f531d140b8398a4680567934fe66cb0ca465fbc
parent: f66a7860291e6b2fef1844b580c22296dbad9202
Author: ThibG <thib@sitedethib.com>
Date:   Thu, 22 Mar 2018 10:45:48 +0100

Fix MENTION_RE to not match nil usernames (#6862)


Diffstat:

Mapp/models/account.rb2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/models/account.rb b/app/models/account.rb @@ -48,7 +48,7 @@ class Account < ApplicationRecord USERNAME_RE = /[a-z0-9_]+([a-z0-9_\.]+[a-z0-9_]+)?/i - MENTION_RE = /(?<=^|[^\/[:word:]])@((#{USERNAME_RE}?)(?:@[a-z0-9\.\-]+[a-z0-9]+)?)/i + MENTION_RE = /(?<=^|[^\/[:word:]])@((#{USERNAME_RE})(?:@[a-z0-9\.\-]+[a-z0-9]+)?)/i include AccountAvatar include AccountFinderConcern