summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMark Felder <feld@feld.me>2024-02-05 00:09:37 -0500
committerMark Felder <feld@feld.me>2024-02-05 00:09:37 -0500
commit0cc038b67c231090827c1b4e71a32f65ee7c3d88 (patch)
tree807c250040165fd768477586b9d5c1df534e865a /lib
parent579561e97ba83183022d4bd2658522be6b6ae202 (diff)
Ensure URLs with IP addresses for the host do not generate previews
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/rich_media/helpers.ex3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/pleroma/web/rich_media/helpers.ex b/lib/pleroma/web/rich_media/helpers.ex
index 9d6b8a38b..1501776d9 100644
--- a/lib/pleroma/web/rich_media/helpers.ex
+++ b/lib/pleroma/web/rich_media/helpers.ex
@@ -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