Add configurable account field value length limit
This commit is contained in:
parent
7d6f8a7fd7
commit
db3c05f6b4
4 changed files with 33 additions and 7 deletions
|
|
@ -308,7 +308,12 @@ defmodule Pleroma.User.Info do
|
|||
end
|
||||
|
||||
defp valid_field?(%{"name" => name, "value" => value}) do
|
||||
is_binary(name) && is_binary(value)
|
||||
value_limit = Pleroma.Config.get([:instance, :account_field_value_length], 255)
|
||||
|
||||
is_binary(name) &&
|
||||
is_binary(value) &&
|
||||
String.length(name) <= 255 &&
|
||||
String.length(value) <= value_limit
|
||||
end
|
||||
|
||||
defp valid_field?(_), do: false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue