Make funny out-of-bounds images configurable
This commit is contained in:
@@ -297,6 +297,7 @@ config :pleroma, :markup,
|
||||
allow_headings: false,
|
||||
allow_tables: false,
|
||||
allow_fonts: false,
|
||||
allow_custom_classes: false,
|
||||
scrub_policy: [
|
||||
Pleroma.HTML.Scrubber.Default,
|
||||
Pleroma.HTML.Transform.MediaProxy
|
||||
|
||||
@@ -76,14 +76,24 @@ defmodule Pleroma.HTML.Scrubber.Default do
|
||||
# restrict img tags to http/https only, because of MediaProxy.
|
||||
Meta.allow_tag_with_uri_attributes(:img, ["src"], ["http", "https"])
|
||||
|
||||
Meta.allow_tag_with_this_attribute_values(:img, ["class"], ["emoji"])
|
||||
if Pleroma.Config.get([:markup, :allow_custom_classes]) do
|
||||
Meta.allow_tag_with_this_attribute_values(:img, ["class"], ["emoji"])
|
||||
|
||||
Meta.allow_tag_with_these_attributes(:img, [
|
||||
"width",
|
||||
"height",
|
||||
"title",
|
||||
"alt"
|
||||
])
|
||||
Meta.allow_tag_with_these_attributes(:img, [
|
||||
"width",
|
||||
"height",
|
||||
"title",
|
||||
"alt"
|
||||
])
|
||||
else
|
||||
Meta.allow_tag_with_these_attributes(:img, [
|
||||
"width",
|
||||
"height",
|
||||
"class",
|
||||
"title",
|
||||
"alt"
|
||||
])
|
||||
end
|
||||
end
|
||||
|
||||
if Pleroma.Config.get([:markup, :allow_tables]) do
|
||||
|
||||
Reference in New Issue
Block a user