Skip to content
Snippets Groups Projects
Unverified Commit 8386d9ec authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub
Browse files

Fix hashtag timeline REST API accepting too many hashtags (#12091)

parent a5821856
No related branches found
No related tags found
No related merge requests found
# frozen_string_literal: true
class HashtagQueryService < BaseService
LIMIT_PER_MODE = 4
def call(tag, params, account = nil, local = false)
tags = tags_for(Array(tag.name) | Array(params[:any])).pluck(:id)
all = tags_for(params[:all])
......@@ -15,6 +17,6 @@ class HashtagQueryService < BaseService
private
def tags_for(names)
Tag.matching_name(names) if names.presence
Tag.matching_name(Array(names).take(LIMIT_PER_MODE)) if names.present?
end
end
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