0
0
Fork 0

Fix tagged param not being normalized before querying tags (#10249)

This commit is contained in:
Eugen Rochko 2019-03-13 13:02:13 +01:00 committed by GitHub
parent d4ef90eae3
commit 06663fcf87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 4 deletions

View file

@ -69,7 +69,13 @@ class Api::V1::Accounts::StatusesController < Api::BaseController
end
def hashtag_scope
Status.tagged_with(Tag.find_by(name: params[:tagged])&.id)
tag = Tag.find_normalized(params[:tagged])
if tag
Status.tagged_with(tag.id)
else
Status.none
end
end
def pagination_params(core_params)

View file

@ -14,7 +14,7 @@ class Api::V1::Timelines::TagController < Api::BaseController
private
def load_tag
@tag = Tag.find_by(name: params[:id].downcase)
@tag = Tag.find_normalized(params[:id])
end
def load_statuses