diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2020-02-08 17:29:40 +0100 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2020-02-20 23:05:50 -0600 |
commit | 03953a045149853d3bada69bbb8e91c4c5e53d62 (patch) | |
tree | 3ce7ec4347711523eff0ee13f9e4f08cc91860a7 /app | |
parent | 818075cd42c2a5020ee22a52c63bae9ab5fecf88 (diff) |
Fix unfiltered params error when generating ActivityPub tag pagination (#13049)
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/tags_controller.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 952e59119..a1d03ce56 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -27,7 +27,7 @@ class TagsController < ApplicationController format.rss do expires_in 0, public: true - @statuses = HashtagQueryService.new.call(@tag, params.slice(:any, :all, :none)).limit(PAGE_SIZE) + @statuses = HashtagQueryService.new.call(@tag, filter_params).limit(PAGE_SIZE) @statuses = cache_collection(@statuses, Status) render xml: RSS::TagSerializer.render(@tag, @statuses) @@ -36,7 +36,7 @@ class TagsController < ApplicationController format.json do expires_in 3.minutes, public: public_fetch_mode? - @statuses = HashtagQueryService.new.call(@tag, params.slice(:any, :all, :none), current_account, params[:local]).paginate_by_max_id(PAGE_SIZE, params[:max_id]) + @statuses = HashtagQueryService.new.call(@tag, filter_params, current_account, params[:local]).paginate_by_max_id(PAGE_SIZE, params[:max_id]) @statuses = cache_collection(@statuses, Status) render json: collection_presenter, serializer: ActivityPub::CollectionSerializer, adapter: ActivityPub::Adapter, content_type: 'application/activity+json' @@ -60,10 +60,14 @@ class TagsController < ApplicationController def collection_presenter ActivityPub::CollectionPresenter.new( - id: tag_url(@tag, params.slice(:any, :all, :none)), + id: tag_url(@tag, filter_params), type: :ordered, size: @tag.statuses.count, items: @statuses.map { |s| ActivityPub::TagManager.instance.uri_for(s) } ) end + + def filter_params + params.slice(:any, :all, :none).permit(:any, :all, :none) + end end |