diff options
author | lain <lain@soykaf.club> | 2019-11-29 10:10:30 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2019-11-29 10:10:30 +0000 |
commit | a990374e80ece3d28ae23f603bd5e301886e6a0c (patch) | |
tree | 4a9eaf861935640a85daac7d25d7e2d1976be788 /test/html_test.exs | |
parent | d7b40dd4ba5bf3890be8a8b69d5aff84f5ffc5d2 (diff) | |
parent | a98cda77580ead154dd2cb020c6d4ebc1e719d86 (diff) | |
download | pleroma-a990374e80ece3d28ae23f603bd5e301886e6a0c.tar.gz pleroma-a990374e80ece3d28ae23f603bd5e301886e6a0c.zip |
Merge branch 'fix/extract_first_external_url' into 'develop'
Fix Pleroma.HTML.extract_first_external_url/2
Closes #1451
See merge request pleroma/pleroma!2024
Diffstat (limited to 'test/html_test.exs')
-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 |