about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-03-30 18:28:07 +0200
committerGitHub <noreply@github.com>2022-03-30 18:28:07 +0200
commit363773d0e9ffa9f4efc564603327f225193a2bf1 (patch)
tree2b8b804b5fd0265f57ae87f3b0315c6c8d14c9ef /app/lib
parent60f9973f452100475874cd9bd0a8b6ee908bf8e0 (diff)
parentfc5dd0c538a8cf33d007a01e168b3bfc0cdc9060 (diff)
Merge pull request #1726 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/extractor.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/lib/extractor.rb b/app/lib/extractor.rb
index ef9407864..aea60dae5 100644
--- a/app/lib/extractor.rb
+++ b/app/lib/extractor.rb
@@ -1,6 +1,8 @@
 # frozen_string_literal: true
 
 module Extractor
+  MAX_DOMAIN_LENGTH = 253
+
   extend Twitter::TwitterText::Extractor
 
   module_function
@@ -30,6 +32,10 @@ module Extractor
       after      = $'
 
       unless Twitter::TwitterText::Regex[:end_mention_match].match?(after)
+        _, domain = screen_name.split('@')
+
+        next if domain.present? && domain.length > MAX_DOMAIN_LENGTH
+
         start_position = match_data.char_begin(1) - 1
         end_position   = match_data.char_end(1)