From: William Pitcock Date: Sat, 22 Sep 2018 01:10:53 +0000 (+0000) Subject: html: default to using normal scrub policy if provided scrub policy is nil X-Git-Url: http://git.squeep.com/?a=commitdiff_plain;h=8ae9424edb753097f4c2093bbded946f938d99e7;p=akkoma html: default to using normal scrub policy if provided scrub policy is nil --- diff --git a/lib/pleroma/html.ex b/lib/pleroma/html.ex index ab62dd1da..878fac28c 100644 --- a/lib/pleroma/html.ex +++ b/lib/pleroma/html.ex @@ -12,17 +12,19 @@ defmodule Pleroma.HTML do |> get_scrubbers end - def filter_tags(html, scrubber) do - html |> Scrubber.scrub(scrubber) - end - - def filter_tags(html) do + def filter_tags(html, nil) do get_scrubbers() |> Enum.reduce(html, fn scrubber, html -> filter_tags(html, scrubber) end) end + def filter_tags(html, scrubber) do + html |> Scrubber.scrub(scrubber) + end + + def filter_tags(html), do: filter_tags(html, nil) + def strip_tags(html) do html |> Scrubber.scrub(Scrubber.StripTags) end