Merge branch 'length-limit-bio' into 'develop'

Add configurable length limits for `User.bio` and `User.name`

See merge request pleroma/pleroma!1515
This commit is contained in:
rinpatch 2019-08-13 22:40:13 +00:00
commit 83a3de8cc4
5 changed files with 30 additions and 18 deletions

View file

@ -525,7 +525,10 @@ defmodule Pleroma.UserTest do
end
test "it restricts some sizes" do
[bio: 5000, name: 100]
bio_limit = Pleroma.Config.get([:instance, :user_bio_length], 5000)
name_limit = Pleroma.Config.get([:instance, :user_name_length], 100)
[bio: bio_limit, name: name_limit]
|> Enum.each(fn {field, size} ->
string = String.pad_leading(".", size)
cs = User.remote_user_creation(Map.put(@valid_remote, field, string))