From: Maksim Pechnikov Date: Wed, 26 Jun 2019 03:24:12 +0000 (+0300) Subject: fix validate_page_url X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=5c0f646cef37e1abc02f5c8a64205d81b2d4d4c4;p=akkoma fix validate_page_url --- diff --git a/lib/pleroma/web/rich_media/helpers.ex b/lib/pleroma/web/rich_media/helpers.ex index 4ece3e846..6506de46c 100644 --- a/lib/pleroma/web/rich_media/helpers.ex +++ b/lib/pleroma/web/rich_media/helpers.ex @@ -9,12 +9,12 @@ defmodule Pleroma.Web.RichMedia.Helpers do alias Pleroma.Object alias Pleroma.Web.RichMedia.Parser - @validate_tld Application.get_env(:auto_linker, :opts)[:validate_tld] - @spec validate_page_url(any()) :: :ok | :error defp validate_page_url(page_url) when is_binary(page_url) do + validate_tld = Application.get_env(:auto_linker, :opts)[:validate_tld] + page_url - |> AutoLinker.Parser.url?(scheme: true, validate_tld: @validate_tld) + |> AutoLinker.Parser.url?(scheme: true, validate_tld: validate_tld) |> parse_uri(page_url) end