Skip to content
Snippets Groups Projects
Unverified Commit 7b63c546 authored by ThibG's avatar ThibG Committed by GitHub
Browse files

Fix announcements with fully-qualified mention to local user crashing WebUI (#13164)

parent aa8568b7
No related branches found
No related tags found
No related merge requests found
......@@ -478,7 +478,16 @@ class Account < ApplicationRecord
def from_text(text)
return [] if text.blank?
text.scan(MENTION_RE).map { |match| match.first.split('@', 2) }.uniq.map { |(username, domain)| EntityCache.instance.mention(username, domain) }
text.scan(MENTION_RE).map { |match| match.first.split('@', 2) }.uniq.map do |(username, domain)|
domain = begin
if TagManager.instance.local_domain?(domain)
nil
else
TagManager.instance.normalize_domain(domain)
end
end
EntityCache.instance.mention(username, domain)
end.compact
end
private
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment