mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-30 14:57:59 +01:00
d851e8cf62
line-heights ability to edit filters fix tag parameter decoding again better error_tag message
18 lines
No EOL
403 B
Elixir
18 lines
No EOL
403 B
Elixir
defmodule PhilomenaWeb.RecodeParameterPlug do
|
|
def init(opts), do: opts
|
|
|
|
def call(conn, [name: name]) do
|
|
fixed_value =
|
|
conn
|
|
|> Map.get(:params)
|
|
|> Map.get(name)
|
|
|> to_string()
|
|
|> URI.encode_www_form()
|
|
|> String.replace("%2B", "+")
|
|
|> String.replace("%25", "%")
|
|
|
|
params = Map.put(conn.params, name, fixed_value)
|
|
|
|
%{conn | params: params}
|
|
end
|
|
end |