From 7a1cb752dd41856cfbfb2078353e5703a8ec375c Mon Sep 17 00:00:00 2001 From: lain Date: Tue, 12 Jan 2021 12:59:50 +0100 Subject: [PATCH] Pagination: Don't be dos'd by random parameters. --- lib/pleroma/web/controller_helper.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pleroma/web/controller_helper.ex b/lib/pleroma/web/controller_helper.ex index 2df44309c..0d112a932 100644 --- a/lib/pleroma/web/controller_helper.ex +++ b/lib/pleroma/web/controller_helper.ex @@ -67,7 +67,7 @@ defmodule Pleroma.Web.ControllerHelper do defp build_pagination_fields(conn, min_id, max_id, extra_params) do params = conn.params - |> Map.drop(Map.keys(conn.path_params) |> Enum.map(&String.to_atom/1)) + |> Map.drop(Map.keys(conn.path_params) |> Enum.map(&String.to_existing_atom/1)) |> Map.merge(extra_params) |> Map.drop(@id_keys) -- 2.45.2