This commit is contained in:
parent
09b6380cdf
commit
f7bf3907a6
1 changed files with 7 additions and 1 deletions
|
@ -2386,6 +2386,7 @@ defp valid_field?(%{"name" => name, "value" => value}) do
|
|||
|
||||
defp valid_field?(_), do: false
|
||||
|
||||
defp is_url(nil), do: nil
|
||||
defp is_url(uri) do
|
||||
case URI.parse(uri) do
|
||||
%URI{host: nil} -> false
|
||||
|
@ -2417,7 +2418,12 @@ defp validate_rel_me_field(changeset, fields, raw_fields, %User{
|
|||
fields
|
||||
|> Enum.with_index()
|
||||
|> Enum.map(fn {%{"name" => name, "value" => value}, index} ->
|
||||
raw_value = Enum.at(raw_fields, index)["value"]
|
||||
raw_value =
|
||||
if is_nil(raw_fields) do
|
||||
nil
|
||||
else
|
||||
Enum.at(raw_fields, index)["value"]
|
||||
end
|
||||
|
||||
if is_url(raw_value) do
|
||||
frontend_url =
|
||||
|
|
Loading…
Reference in a new issue