Skip to content
Snippets Groups Projects
Commit 8613db0e authored by kaniini's avatar kaniini
Browse files

html: ensure comments are correctly scrubbed

parent aaf3fc15
Branches
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment