X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=test%2Fhtml_test.exs;h=a006fd4924125e9f922b0ef937f75ba988f8629d;hb=32b8386edeec3e9b24123c3ccc81a22f1edd5a1c;hp=f0869534cdced6047d9ba72be9f1b27c3a00961b;hpb=74135e13188a573313a40f147fe76a9a31b909d4;p=akkoma
diff --git a/test/html_test.exs b/test/html_test.exs
index f0869534c..a006fd492 100644
--- a/test/html_test.exs
+++ b/test/html_test.exs
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.HTMLTest do
@@ -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