[#3213] Ignoring of blank elements from objects.data->tag.

This commit is contained in:
Ivan Tashkinov 2021-01-21 20:50:06 +03:00
commit ca7f240643
2 changed files with 19 additions and 0 deletions

View file

@ -420,6 +420,8 @@ defmodule Pleroma.Object do
hashtag when is_bitstring(hashtag) -> String.downcase(hashtag)
end)
|> Enum.uniq()
# Note: "" elements (plain text) might occur in `data.tag` for incoming objects
|> Enum.filter(&(&1 not in [nil, ""]))
end
def object_data_hashtags(_), do: []