Pagination: Don't be dos'd by random parameters.
authorlain <lain@soykaf.club>
Tue, 12 Jan 2021 11:59:50 +0000 (12:59 +0100)
committerlain <lain@soykaf.club>
Tue, 12 Jan 2021 11:59:50 +0000 (12:59 +0100)
lib/pleroma/web/controller_helper.ex

index 2df44309cd8ef9d7de9b6f9be57a185ca908bac7..0d112a932ae7db686f1cbbf1cb5282bd16e0b373 100644 (file)
@@ -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)