diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2018-03-01 02:47:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-01 02:47:59 +0100 |
commit | fce8464077dfca64c3bc9a52b7bcde50c9ac555e (patch) | |
tree | e99eedf4a8e23ae1415ac51e833751510e6ec2b4 /app/controllers/api/v1/timelines | |
parent | 47bdb9b33b021c92bdfc6698914776eda13f6f77 (diff) |
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.
Diffstat (limited to 'app/controllers/api/v1/timelines')
-rw-r--r-- | app/controllers/api/v1/timelines/public_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/api/v1/timelines/tag_controller.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/api/v1/timelines/public_controller.rb b/app/controllers/api/v1/timelines/public_controller.rb index 49887778e..98d3ae157 100644 --- a/app/controllers/api/v1/timelines/public_controller.rb +++ b/app/controllers/api/v1/timelines/public_controller.rb @@ -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 diff --git a/app/controllers/api/v1/timelines/tag_controller.rb b/app/controllers/api/v1/timelines/tag_controller.rb index 08db04a39..9b46c7bb3 100644 --- a/app/controllers/api/v1/timelines/tag_controller.rb +++ b/app/controllers/api/v1/timelines/tag_controller.rb @@ -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 |