Unverified Commit 33513753 authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub

Fix unpermitted parameters warning when generating pagination URLs (#6995)

parent 123a343d
...@@ -63,6 +63,6 @@ class Api::V1::Accounts::FollowerAccountsController < Api::BaseController ...@@ -63,6 +63,6 @@ class Api::V1::Accounts::FollowerAccountsController < Api::BaseController
end end
def pagination_params(core_params) def pagination_params(core_params)
params.permit(:limit).merge(core_params) params.slice(:limit).permit(:limit).merge(core_params)
end end
end end
...@@ -63,6 +63,6 @@ class Api::V1::Accounts::FollowingAccountsController < Api::BaseController ...@@ -63,6 +63,6 @@ class Api::V1::Accounts::FollowingAccountsController < Api::BaseController
end end
def pagination_params(core_params) def pagination_params(core_params)
params.permit(:limit).merge(core_params) params.slice(:limit).permit(:limit).merge(core_params)
end end
end end
...@@ -69,7 +69,7 @@ class Api::V1::Accounts::StatusesController < Api::BaseController ...@@ -69,7 +69,7 @@ class Api::V1::Accounts::StatusesController < Api::BaseController
end end
def pagination_params(core_params) def pagination_params(core_params)
params.permit(:limit, :only_media, :exclude_replies).merge(core_params) params.slice(:limit, :only_media, :exclude_replies).permit(:limit, :only_media, :exclude_replies).merge(core_params)
end end
def insert_pagination_headers def insert_pagination_headers
......
...@@ -57,6 +57,6 @@ class Api::V1::BlocksController < Api::BaseController ...@@ -57,6 +57,6 @@ class Api::V1::BlocksController < Api::BaseController
end end
def pagination_params(core_params) def pagination_params(core_params)
params.permit(:limit).merge(core_params) params.slice(:limit).permit(:limit).merge(core_params)
end end
end end
...@@ -67,7 +67,7 @@ class Api::V1::DomainBlocksController < Api::BaseController ...@@ -67,7 +67,7 @@ class Api::V1::DomainBlocksController < Api::BaseController
end end
def pagination_params(core_params) def pagination_params(core_params)
params.permit(:limit).merge(core_params) params.slice(:limit).permit(:limit).merge(core_params)
end end
def domain_block_params def domain_block_params
......
...@@ -66,6 +66,6 @@ class Api::V1::FavouritesController < Api::BaseController ...@@ -66,6 +66,6 @@ class Api::V1::FavouritesController < Api::BaseController
end end
def pagination_params(core_params) def pagination_params(core_params)
params.permit(:limit).merge(core_params) params.slice(:limit).permit(:limit).merge(core_params)
end end
end end
...@@ -71,6 +71,6 @@ class Api::V1::FollowRequestsController < Api::BaseController ...@@ -71,6 +71,6 @@ class Api::V1::FollowRequestsController < Api::BaseController
end end
def pagination_params(core_params) def pagination_params(core_params)
params.permit(:limit).merge(core_params) params.slice(:limit).permit(:limit).merge(core_params)
end end
end end
...@@ -88,7 +88,7 @@ class Api::V1::Lists::AccountsController < Api::BaseController ...@@ -88,7 +88,7 @@ class Api::V1::Lists::AccountsController < Api::BaseController
end end
def pagination_params(core_params) def pagination_params(core_params)
params.permit(:limit).merge(core_params) params.slice(:limit).permit(:limit).merge(core_params)
end end
def unlimited? def unlimited?
......
...@@ -59,6 +59,6 @@ class Api::V1::MutesController < Api::BaseController ...@@ -59,6 +59,6 @@ class Api::V1::MutesController < Api::BaseController
end end
def pagination_params(core_params) def pagination_params(core_params)
params.permit(:limit).merge(core_params) params.slice(:limit).permit(:limit).merge(core_params)
end end
end end
...@@ -82,6 +82,6 @@ class Api::V1::NotificationsController < Api::BaseController ...@@ -82,6 +82,6 @@ class Api::V1::NotificationsController < Api::BaseController
end end
def pagination_params(core_params) def pagination_params(core_params)
params.permit(:limit, exclude_types: []).merge(core_params) params.slice(:limit, :exclude_types).permit(:limit, exclude_types: []).merge(core_params)
end end
end end
...@@ -77,6 +77,6 @@ class Api::V1::Statuses::FavouritedByAccountsController < Api::BaseController ...@@ -77,6 +77,6 @@ class Api::V1::Statuses::FavouritedByAccountsController < Api::BaseController
end end
def pagination_params(core_params) def pagination_params(core_params)
params.permit(:limit).merge(core_params) params.slice(:limit).permit(:limit).merge(core_params)
end end
end end
...@@ -74,6 +74,6 @@ class Api::V1::Statuses::RebloggedByAccountsController < Api::BaseController ...@@ -74,6 +74,6 @@ class Api::V1::Statuses::RebloggedByAccountsController < Api::BaseController
end end
def pagination_params(core_params) def pagination_params(core_params)
params.permit(:limit).merge(core_params) params.slice(:limit).permit(:limit).merge(core_params)
end end
end end
...@@ -76,7 +76,7 @@ class Api::V1::StatusesController < Api::BaseController ...@@ -76,7 +76,7 @@ class Api::V1::StatusesController < Api::BaseController
end end
def pagination_params(core_params) def pagination_params(core_params)
params.permit(:limit).merge(core_params) params.slice(:limit).permit(:limit).merge(core_params)
end end
def authorize_if_got_token def authorize_if_got_token
......
...@@ -43,7 +43,7 @@ class Api::V1::Timelines::HomeController < Api::BaseController ...@@ -43,7 +43,7 @@ class Api::V1::Timelines::HomeController < Api::BaseController
end end
def pagination_params(core_params) def pagination_params(core_params)
params.permit(:local, :limit).merge(core_params) params.slice(:local, :limit).permit(:local, :limit).merge(core_params)
end end
def next_path def next_path
......
...@@ -45,7 +45,7 @@ class Api::V1::Timelines::ListController < Api::BaseController ...@@ -45,7 +45,7 @@ class Api::V1::Timelines::ListController < Api::BaseController
end end
def pagination_params(core_params) def pagination_params(core_params)
params.permit(:limit).merge(core_params) params.slice(:limit).permit(:limit).merge(core_params)
end end
def next_path def next_path
......
...@@ -45,7 +45,7 @@ class Api::V1::Timelines::PublicController < Api::BaseController ...@@ -45,7 +45,7 @@ class Api::V1::Timelines::PublicController < Api::BaseController
end end
def pagination_params(core_params) def pagination_params(core_params)
params.permit(:local, :limit, :only_media).merge(core_params) params.slice(:local, :limit, :only_media).permit(:local, :limit, :only_media).merge(core_params)
end end
def next_path def next_path
......
...@@ -54,7 +54,7 @@ class Api::V1::Timelines::TagController < Api::BaseController ...@@ -54,7 +54,7 @@ class Api::V1::Timelines::TagController < Api::BaseController
end end
def pagination_params(core_params) def pagination_params(core_params)
params.permit(:local, :limit, :only_media).merge(core_params) params.slice(:local, :limit, :only_media).permit(:local, :limit, :only_media).merge(core_params)
end end
def next_path def next_path
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment