lib/pleroma/html.ex: Fix scheme lists
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Tue, 16 Oct 2018 01:00:37 +0000 (03:00 +0200)
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Tue, 16 Oct 2018 01:00:37 +0000 (03:00 +0200)
Gosh please don’t break ourselves…

Also this is copy-paste of the list in lib/pleroma/formatter.ex,
I think this should be put in a common variable, but where?

lib/pleroma/html.ex

index cf18f070c68732297dfacd16335417563f96ed07..f86855671859d2089568ab25044ce6757f804df1 100644 (file)
@@ -39,7 +39,22 @@ defmodule Pleroma.HTML.Scrubber.TwitterText do
   require HtmlSanitizeEx.Scrubber.Meta
   alias HtmlSanitizeEx.Scrubber.Meta
 
-  @valid_schemes ["http", "https"]
+  @valid_schemes [
+    "https://",
+    "http://",
+    "dat://",
+    "dweb://",
+    "gopher://",
+    "ipfs://",
+    "ipns://",
+    "irc:",
+    "ircs:",
+    "magnet:",
+    "mailto:",
+    "mumble:",
+    "ssb://",
+    "xmpp:"
+  ]
 
   Meta.remove_cdata_sections_before_scrub()
   Meta.strip_comments()