about summary refs log tree commit diff
path: root/app/controllers/activitypub
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2021-09-15 18:51:16 +0200
committerGitHub <noreply@github.com>2021-09-15 18:51:16 +0200
commite0af97164af6440f439a2aa7ec0b4d11c1121097 (patch)
tree0c27eb95ea9e93a59217e2fc5df97f192535283e /app/controllers/activitypub
parent8f7308da81e11f6562a7230afe2a9bf33e0c8dcf (diff)
Fix followers synchronization mechanism not working when URI has empty path (#16744)
Follow-up to #16510, forgot the controller exposing the actual followers…
Diffstat (limited to 'app/controllers/activitypub')
-rw-r--r--app/controllers/activitypub/followers_synchronizations_controller.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/activitypub/followers_synchronizations_controller.rb b/app/controllers/activitypub/followers_synchronizations_controller.rb
index 525031105..940b77cf0 100644
--- a/app/controllers/activitypub/followers_synchronizations_controller.rb
+++ b/app/controllers/activitypub/followers_synchronizations_controller.rb
@@ -19,11 +19,11 @@ class ActivityPub::FollowersSynchronizationsController < ActivityPub::BaseContro
   private
 
   def uri_prefix
-    signed_request_account.uri[/http(s?):\/\/[^\/]+\//]
+    signed_request_account.uri[Account::URL_PREFIX_RE]
   end
 
   def set_items
-    @items = @account.followers.where(Account.arel_table[:uri].matches(uri_prefix + '%', false, true)).pluck(:uri)
+    @items = @account.followers.where(Account.arel_table[:uri].matches("#{Account.sanitize_sql_like(uri_prefix)}/%", false, true)).or(@account.followers.where(uri: uri_prefix)).pluck(:uri)
   end
 
   def collection_presenter