Merge branch 'docs/direct_conversation_id' into 'develop'
[akkoma] / lib / pleroma / web / activity_pub / mrf / anti_link_spam_policy.ex
index 8abe18e29530db74d58b4d9766c209d4026b4109..9e78009975e8cda92ee599ac83b81e542c436632 100644 (file)
@@ -1,5 +1,5 @@
 # Pleroma: A lightweight social networking server
-# Copyright © 2019 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.Web.ActivityPub.MRF.AntiLinkSpamPolicy do
@@ -17,6 +17,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.AntiLinkSpamPolicy do
   # does the post contain links?
   defp contains_links?(%{"content" => content} = _object) do
     content
+    |> Floki.parse_fragment!()
     |> Floki.filter_out("a.mention,a.hashtag,a[rel~=\"tag\"],a.zrl")
     |> Floki.attribute("a", "href")
     |> length() > 0