aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaniini <nenolod@gmail.com>2018-10-23 00:56:09 +0000
committerkaniini <nenolod@gmail.com>2018-10-23 00:56:09 +0000
commit945ce9910dc7b29147ec49af0bdb82202008c7c4 (patch)
treeb5c7397a647546e8ecdf525bc0d8b437137428e4
parentbcae57afd2f932db4b3c4ee28428ed101f0fec1f (diff)
parent8613db0e3b2d998e0e0a336562e872e4b38f2a26 (diff)
downloadpleroma-945ce9910dc7b29147ec49af0bdb82202008c7c4.tar.gz
Merge branch 'bugfix/html-scrub-comments' into 'develop'
html: ensure comments are correctly scrubbed See merge request pleroma/pleroma!384
-rw-r--r--lib/pleroma/html.ex6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/pleroma/html.ex b/lib/pleroma/html.ex
index fdc5e7dab..a7338eac3 100644
--- a/lib/pleroma/html.ex
+++ b/lib/pleroma/html.ex
@@ -43,8 +43,6 @@ defmodule Pleroma.HTML.Scrubber.TwitterText do
require HtmlSanitizeEx.Scrubber.Meta
alias HtmlSanitizeEx.Scrubber.Meta
- alias Pleroma.HTML
-
Meta.remove_cdata_sections_before_scrub()
Meta.strip_comments()
@@ -83,8 +81,6 @@ defmodule Pleroma.HTML.Scrubber.Default do
require HtmlSanitizeEx.Scrubber.Meta
alias HtmlSanitizeEx.Scrubber.Meta
- alias Pleroma.HTML
-
@markup Application.get_env(:pleroma, :markup)
@uri_schemes Application.get_env(:pleroma, :uri_schemes, [])
@valid_schemes Keyword.get(@uri_schemes, :valid_schemes, [])
@@ -181,6 +177,8 @@ defmodule Pleroma.HTML.Transform.MediaProxy do
{"img", attributes, children}
end
+ def scrub({:comment, children}), do: ""
+
def scrub({tag, attributes, children}), do: {tag, attributes, children}
def scrub({tag, children}), do: children
def scrub(text), do: text