From 2b3d1d7f792a1f4817c909a6a95285da9a6a5501 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 20 Oct 2020 09:36:57 +0200 Subject: [PATCH] Fix issue with hostname validation Signed-off-by: Thomas Citharel --- lib/service/rich_media/parser.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/service/rich_media/parser.ex b/lib/service/rich_media/parser.ex index a65e33dac..12face84b 100644 --- a/lib/service/rich_media/parser.ex +++ b/lib/service/rich_media/parser.ex @@ -241,7 +241,7 @@ defmodule Mobilizon.Service.RichMedia.Parser do !String.ends_with?(hostname, ".localhost") defp validate_hostname_only(hostname), - do: hostname |> String.graphemes() |> Enum.count(&(&1 == "o")) > 0 + do: hostname |> String.graphemes() |> Enum.count(&(&1 == ".")) > 0 defp validate_ip(hostname) do case hostname |> String.to_charlist() |> :inet.parse_address() do