summaryrefslogtreecommitdiff
path: root/test/web/activity_pub/object_validators
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-05-30 12:17:18 +0200
committerlain <lain@soykaf.club>2020-05-30 12:17:18 +0200
commit2c9465cc51160546ae054d1a1912fbb8e9add8e8 (patch)
tree132c941b0e7371cfd290627b8986fe2349caeab2 /test/web/activity_pub/object_validators
parent32431ad1ee88d260b720fab05fce76eb75bfe107 (diff)
downloadpleroma-2c9465cc51160546ae054d1a1912fbb8e9add8e8.tar.gz
pleroma-2c9465cc51160546ae054d1a1912fbb8e9add8e8.zip
SafeText: Let through basic html.
Diffstat (limited to 'test/web/activity_pub/object_validators')
-rw-r--r--test/web/activity_pub/object_validators/types/safe_text_test.exs7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/web/activity_pub/object_validators/types/safe_text_test.exs b/test/web/activity_pub/object_validators/types/safe_text_test.exs
index 59ed0a1fe..d4a574554 100644
--- a/test/web/activity_pub/object_validators/types/safe_text_test.exs
+++ b/test/web/activity_pub/object_validators/types/safe_text_test.exs
@@ -17,6 +17,13 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.Types.SafeTextTest do
assert {:ok, "hey look xss alert(&#39;foo&#39;)"} == SafeText.cast(text)
end
+ test "it keeps basic html tags" do
+ text = "hey <a href='http://gensokyo.2hu'>look</a> xss <script>alert('foo')</script>"
+
+ assert {:ok, "hey <a href=\"http://gensokyo.2hu\">look</a> xss alert(&#39;foo&#39;)"} ==
+ SafeText.cast(text)
+ end
+
test "errors for non-text" do
assert :error == SafeText.cast(1)
end