diff options
author | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2022-11-27 03:40:21 +0100 |
---|---|---|
committer | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2022-11-27 03:40:21 +0100 |
commit | 8f3e750530874df2a92d131e256e94dcc77260f1 (patch) | |
tree | a57bffad1d442821f00ad8827eb80dbb44406842 /priv | |
parent | 7f0b3161eab7d3a3de7103d83ba62ee05ec1c28f (diff) | |
download | pleroma-8f3e750530874df2a92d131e256e94dcc77260f1.tar.gz pleroma-8f3e750530874df2a92d131e256e94dcc77260f1.zip |
scrubbers: Scrub img class attribute
Closes: https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3790
Diffstat (limited to 'priv')
-rw-r--r-- | priv/scrubbers/default.ex | 3 | ||||
-rw-r--r-- | priv/scrubbers/twitter_text.ex | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/priv/scrubbers/default.ex b/priv/scrubbers/default.ex index 79fa6dcdf..e10e3ec87 100644 --- a/priv/scrubbers/default.ex +++ b/priv/scrubbers/default.ex @@ -68,13 +68,14 @@ defmodule Pleroma.HTML.Scrubber.Default do @allow_inline_images Pleroma.Config.get([:markup, :allow_inline_images]) if @allow_inline_images do + Meta.allow_tag_with_this_attribute_values(:img, "class", ["emoji"]) + # restrict img tags to http/https only, because of MediaProxy. Meta.allow_tag_with_uri_attributes(:img, ["src"], ["http", "https"]) Meta.allow_tag_with_these_attributes(:img, [ "width", "height", - "class", "title", "alt" ]) diff --git a/priv/scrubbers/twitter_text.ex b/priv/scrubbers/twitter_text.ex index a121a8209..6e23b3efb 100644 --- a/priv/scrubbers/twitter_text.ex +++ b/priv/scrubbers/twitter_text.ex @@ -45,13 +45,14 @@ defmodule Pleroma.HTML.Scrubber.TwitterText do # allow inline images for custom emoji if Pleroma.Config.get([:markup, :allow_inline_images]) do + Meta.allow_tag_with_this_attribute_values(:img, "class", ["emoji"]) + # restrict img tags to http/https only, because of MediaProxy. Meta.allow_tag_with_uri_attributes(:img, ["src"], ["http", "https"]) Meta.allow_tag_with_these_attributes(:img, [ "width", "height", - "class", "title", "alt" ]) |