From 55b210b3e599fa51186a646572056cda7aa3f23c Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 13 Dec 2022 20:02:32 +0100 Subject: [PATCH] Fix crash and incorrect behavior in tootctl domains crawl (#19004) --- lib/mastodon/domains_cli.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mastodon/domains_cli.rb b/lib/mastodon/domains_cli.rb index a7c78c4a7a..77364ffbbe 100644 --- a/lib/mastodon/domains_cli.rb +++ b/lib/mastodon/domains_cli.rb @@ -97,7 +97,7 @@ module Mastodon failed = Concurrent::AtomicFixnum.new(0) start_at = Time.now.to_f seed = start ? [start] : Instance.pluck(:domain) - blocked_domains = Regexp.new('\\.?' + DomainBlock.where(severity: 1).pluck(:domain).join('|') + '$') + blocked_domains = /\.?(#{DomainBlock.where(severity: 1).pluck(:domain).map { |domain| Regexp.escape(domain) }.join('|')})$/ progress = create_progress_bar pool = Concurrent::ThreadPoolExecutor.new(min_threads: 0, max_threads: options[:concurrency], idletime: 10, auto_terminate: true, max_queue: 0)