Ensure that boolean params in the API are parsed for truthiness (#6575)
Use Rails smart boolean cast to account for values such as "f", "0", "false", etc. Previously, if a param was present in the request, it would count as true.
This commit is contained in:
parent
47bdb9b33b
commit
fce8464077
7 changed files with 13 additions and 17 deletions
|
@ -29,7 +29,7 @@ class Api::V1::Timelines::PublicController < Api::BaseController
|
|||
end
|
||||
|
||||
def public_timeline_statuses
|
||||
Status.as_public_timeline(current_account, params[:local])
|
||||
Status.as_public_timeline(current_account, truthy_param?(:local))
|
||||
end
|
||||
|
||||
def insert_pagination_headers
|
||||
|
|
|
@ -38,7 +38,7 @@ class Api::V1::Timelines::TagController < Api::BaseController
|
|||
end
|
||||
|
||||
def tag_timeline_statuses
|
||||
Status.as_tag_timeline(@tag, current_account, params[:local])
|
||||
Status.as_tag_timeline(@tag, current_account, truthy_param?(:local))
|
||||
end
|
||||
|
||||
def insert_pagination_headers
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue