diff options
| author | lain <lain@soykaf.club> | 2020-05-30 12:17:18 +0200 |
|---|---|---|
| committer | lain <lain@soykaf.club> | 2020-05-30 12:17:18 +0200 |
| commit | 2c9465cc51160546ae054d1a1912fbb8e9add8e8 (patch) | |
| tree | 132c941b0e7371cfd290627b8986fe2349caeab2 /test/web/activity_pub/object_validators | |
| parent | 32431ad1ee88d260b720fab05fce76eb75bfe107 (diff) | |
| download | pleroma-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.exs | 7 |
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('foo')"} == 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('foo')"} == + SafeText.cast(text) + end + test "errors for non-text" do assert :error == SafeText.cast(1) end |
