Rip out the rest of htmlsanitizeex
This commit is contained in:
parent
77cfb08b8c
commit
ae59b38203
|
@ -5,6 +5,7 @@
|
||||||
defmodule Pleroma.BBS.Handler do
|
defmodule Pleroma.BBS.Handler do
|
||||||
use Sshd.ShellHandler
|
use Sshd.ShellHandler
|
||||||
alias Pleroma.Activity
|
alias Pleroma.Activity
|
||||||
|
alias Pleroma.HTML
|
||||||
alias Pleroma.Web.ActivityPub.ActivityPub
|
alias Pleroma.Web.ActivityPub.ActivityPub
|
||||||
alias Pleroma.Web.CommonAPI
|
alias Pleroma.Web.CommonAPI
|
||||||
|
|
||||||
|
@ -44,7 +45,7 @@ defp loop(state) do
|
||||||
def puts_activity(activity) do
|
def puts_activity(activity) do
|
||||||
status = Pleroma.Web.MastodonAPI.StatusView.render("show.json", %{activity: activity})
|
status = Pleroma.Web.MastodonAPI.StatusView.render("show.json", %{activity: activity})
|
||||||
IO.puts("-- #{status.id} by #{status.account.display_name} (#{status.account.acct})")
|
IO.puts("-- #{status.id} by #{status.account.display_name} (#{status.account.acct})")
|
||||||
IO.puts(HtmlSanitizeEx.strip_tags(status.content))
|
IO.puts(HTML.strip_tags(status.content))
|
||||||
IO.puts("")
|
IO.puts("")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -108,8 +108,8 @@ defmodule Pleroma.HTML.Scrubber.TwitterText do
|
||||||
|
|
||||||
@valid_schemes Pleroma.Config.get([:uri_schemes, :valid_schemes], [])
|
@valid_schemes Pleroma.Config.get([:uri_schemes, :valid_schemes], [])
|
||||||
|
|
||||||
require HtmlSanitizeEx.Scrubber.Meta
|
require FastSanitize.Sanitizer.Meta
|
||||||
alias HtmlSanitizeEx.Scrubber.Meta
|
alias FastSanitize.Sanitizer.Meta
|
||||||
|
|
||||||
Meta.strip_comments()
|
Meta.strip_comments()
|
||||||
|
|
||||||
|
@ -291,10 +291,9 @@ defmodule Pleroma.HTML.Scrubber.LinksOnly do
|
||||||
|
|
||||||
@valid_schemes Pleroma.Config.get([:uri_schemes, :valid_schemes], [])
|
@valid_schemes Pleroma.Config.get([:uri_schemes, :valid_schemes], [])
|
||||||
|
|
||||||
require HtmlSanitizeEx.Scrubber.Meta
|
require FastSanitize.Sanitizer.Meta
|
||||||
alias HtmlSanitizeEx.Scrubber.Meta
|
alias FastSanitize.Sanitizer.Meta
|
||||||
|
|
||||||
Meta.remove_cdata_sections_before_scrub()
|
|
||||||
Meta.strip_comments()
|
Meta.strip_comments()
|
||||||
|
|
||||||
# links
|
# links
|
||||||
|
|
1
mix.exs
1
mix.exs
|
@ -108,7 +108,6 @@ defp deps do
|
||||||
{:comeonin, "~> 4.1.1"},
|
{:comeonin, "~> 4.1.1"},
|
||||||
{:pbkdf2_elixir, "~> 0.12.3"},
|
{:pbkdf2_elixir, "~> 0.12.3"},
|
||||||
{:trailing_format_plug, "~> 0.0.7"},
|
{:trailing_format_plug, "~> 0.0.7"},
|
||||||
{:html_sanitize_ex, "~> 1.3.0"},
|
|
||||||
{:fast_sanitize,
|
{:fast_sanitize,
|
||||||
git: "https://git.pleroma.social/pleroma/fast_sanitize.git",
|
git: "https://git.pleroma.social/pleroma/fast_sanitize.git",
|
||||||
ref: "37f55e2bbe6eb44e8a9c4b3831a5ce73a2f6955c"},
|
ref: "37f55e2bbe6eb44e8a9c4b3831a5ce73a2f6955c"},
|
||||||
|
|
|
@ -7,6 +7,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
|
||||||
|
|
||||||
alias Pleroma.Activity
|
alias Pleroma.Activity
|
||||||
alias Pleroma.Bookmark
|
alias Pleroma.Bookmark
|
||||||
|
alias Pleroma.HTML
|
||||||
alias Pleroma.Object
|
alias Pleroma.Object
|
||||||
alias Pleroma.Repo
|
alias Pleroma.Repo
|
||||||
alias Pleroma.User
|
alias Pleroma.User
|
||||||
|
@ -107,7 +108,7 @@ test "a note activity" do
|
||||||
in_reply_to_account_id: nil,
|
in_reply_to_account_id: nil,
|
||||||
card: nil,
|
card: nil,
|
||||||
reblog: nil,
|
reblog: nil,
|
||||||
content: HtmlSanitizeEx.basic_html(object_data["content"]),
|
content: HTML.filter_tags(object_data["content"]),
|
||||||
created_at: created_at,
|
created_at: created_at,
|
||||||
reblogs_count: 0,
|
reblogs_count: 0,
|
||||||
replies_count: 0,
|
replies_count: 0,
|
||||||
|
@ -119,7 +120,7 @@ test "a note activity" do
|
||||||
pinned: false,
|
pinned: false,
|
||||||
sensitive: false,
|
sensitive: false,
|
||||||
poll: nil,
|
poll: nil,
|
||||||
spoiler_text: HtmlSanitizeEx.basic_html(object_data["summary"]),
|
spoiler_text: HTML.filter_tags(object_data["summary"]),
|
||||||
visibility: "public",
|
visibility: "public",
|
||||||
media_attachments: [],
|
media_attachments: [],
|
||||||
mentions: [],
|
mentions: [],
|
||||||
|
@ -146,8 +147,8 @@ test "a note activity" do
|
||||||
local: true,
|
local: true,
|
||||||
conversation_id: convo_id,
|
conversation_id: convo_id,
|
||||||
in_reply_to_account_acct: nil,
|
in_reply_to_account_acct: nil,
|
||||||
content: %{"text/plain" => HtmlSanitizeEx.strip_tags(object_data["content"])},
|
content: %{"text/plain" => HTML.strip_tags(object_data["content"])},
|
||||||
spoiler_text: %{"text/plain" => HtmlSanitizeEx.strip_tags(object_data["summary"])},
|
spoiler_text: %{"text/plain" => HTML.strip_tags(object_data["summary"])},
|
||||||
expires_at: nil,
|
expires_at: nil,
|
||||||
direct_conversation_id: nil,
|
direct_conversation_id: nil,
|
||||||
thread_muted: false
|
thread_muted: false
|
||||||
|
|
Loading…
Reference in a new issue