fix validate_page_url
authorMaksim Pechnikov <parallel588@gmail.com>
Wed, 26 Jun 2019 03:24:12 +0000 (06:24 +0300)
committerMaksim Pechnikov <parallel588@gmail.com>
Wed, 26 Jun 2019 03:27:17 +0000 (06:27 +0300)
lib/pleroma/web/rich_media/helpers.ex

index 4ece3e846ba1c6192db3b71dcb027958676747bf..6506de46c6abecd491cd939e7aeac4f62b01af32 100644 (file)
@@ -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