fix validate_page_url
This commit is contained in:
parent
ec01b7c934
commit
5c0f646cef
@ -9,12 +9,12 @@ defmodule Pleroma.Web.RichMedia.Helpers do
|
|||||||
alias Pleroma.Object
|
alias Pleroma.Object
|
||||||
alias Pleroma.Web.RichMedia.Parser
|
alias Pleroma.Web.RichMedia.Parser
|
||||||
|
|
||||||
@validate_tld Application.get_env(:auto_linker, :opts)[:validate_tld]
|
|
||||||
|
|
||||||
@spec validate_page_url(any()) :: :ok | :error
|
@spec validate_page_url(any()) :: :ok | :error
|
||||||
defp validate_page_url(page_url) when is_binary(page_url) do
|
defp validate_page_url(page_url) when is_binary(page_url) do
|
||||||
|
validate_tld = Application.get_env(:auto_linker, :opts)[:validate_tld]
|
||||||
|
|
||||||
page_url
|
page_url
|
||||||
|> AutoLinker.Parser.url?(scheme: true, validate_tld: @validate_tld)
|
|> AutoLinker.Parser.url?(scheme: true, validate_tld: validate_tld)
|
||||||
|> parse_uri(page_url)
|
|> parse_uri(page_url)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user