diff options
author | Egor Kislitsyn <egor@kislitsyn.com> | 2019-11-29 15:49:35 +0700 |
---|---|---|
committer | Egor Kislitsyn <egor@kislitsyn.com> | 2019-11-29 15:49:35 +0700 |
commit | a98cda77580ead154dd2cb020c6d4ebc1e719d86 (patch) | |
tree | 4a9eaf861935640a85daac7d25d7e2d1976be788 /test | |
parent | d7b40dd4ba5bf3890be8a8b69d5aff84f5ffc5d2 (diff) | |
download | pleroma-a98cda77580ead154dd2cb020c6d4ebc1e719d86.tar.gz |
Fix Pleroma.HTML.extract_first_external_url/2
Diffstat (limited to 'test')
-rw-r--r-- | test/html_test.exs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/html_test.exs b/test/html_test.exs index f0869534c..c918dbe20 100644 --- a/test/html_test.exs +++ b/test/html_test.exs @@ -228,5 +228,16 @@ defmodule Pleroma.HTMLTest do assert url == "https://www.pixiv.net/member_illust.php?mode=medium&illust_id=72255140" end + + test "does not crash when there is an HTML entity in a link" do + user = insert(:user) + + {:ok, activity} = + CommonAPI.post(user, %{"status" => "\"http://cofe.com/?boomer=ok&foo=bar\""}) + + object = Object.normalize(activity) + + assert {:ok, nil} = HTML.extract_first_external_url(object, object.data["content"]) + end end end |