aboutsummaryrefslogtreecommitdiff
path: root/priv
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2021-05-04 18:29:25 -0500
committerAlex Gleason <alex@alexgleason.me>2021-05-04 18:29:25 -0500
commit8b9ff5dab2b0dc4bafe677229e20095bab186a86 (patch)
tree84901655ef85eb35d6821d7e7f19e26751e3b9e6 /priv
parent3a4ad366d524ed4b90f46ede22991ce5249b9a84 (diff)
downloadpleroma-8b9ff5dab2b0dc4bafe677229e20095bab186a86.tar.gz
Sanitize rich media HTML
Diffstat (limited to 'priv')
-rw-r--r--priv/scrubbers/o_embed.ex18
1 files changed, 18 insertions, 0 deletions
diff --git a/priv/scrubbers/o_embed.ex b/priv/scrubbers/o_embed.ex
new file mode 100644
index 000000000..ac419f45d
--- /dev/null
+++ b/priv/scrubbers/o_embed.ex
@@ -0,0 +1,18 @@
+defmodule Pleroma.HTML.Scrubber.OEmbed do
+ @moduledoc """
+ Scrubs OEmbed HTML
+ """
+ require FastSanitize.Sanitizer.Meta
+ alias FastSanitize.Sanitizer.Meta
+
+ Meta.strip_comments()
+
+ Meta.allow_tag_with_these_attributes(:iframe, [
+ "width",
+ "height",
+ "src",
+ "allowfullscreen"
+ ])
+
+ Meta.strip_everything_not_covered()
+end