Ensure URLs with IP addresses for the host do not generate previews

This commit is contained in:
Mark Felder 2024-02-05 00:09:37 -05:00
commit 0cc038b67c
3 changed files with 10 additions and 8 deletions

View file

@ -29,6 +29,9 @@ defmodule Pleroma.Web.RichMedia.Helpers do
defp validate_page_url(%URI{host: host, scheme: "https"}) do
cond do
Linkify.Parser.ip?(host) ->
:error
host in @config_impl.get([:rich_media, :ignore_hosts], []) ->
:error