Compare commits
1 Commits
b675b47c53
...
75d9e2b375
Author | SHA1 | Date |
---|---|---|
Erin Shepherd | 75d9e2b375 |
|
@ -13,7 +13,10 @@ defmodule Pleroma.Web.ActivityPub.MRF.InlineQuotePolicy do
|
|||
end
|
||||
|
||||
defp resolve_urls(quote_url) do
|
||||
with %Object{} = obj <- Object.normalize(quote_url, fetch: true) do
|
||||
# Fetching here can cause infinite recursion as we run this logic on inbound objects too
|
||||
# This is probably not a problem - its an exceptional corner case for a local user to quote
|
||||
# a post which doesn't exist
|
||||
with %Object{} = obj <- Object.normalize(quote_url, fetch: false) do
|
||||
id = obj.data["id"]
|
||||
url = Map.get(obj.data, "url", id)
|
||||
{id, url, [id, url, quote_url]}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
defmodule Pleroma.Web.ActivityPub.MRF.InlineQuotePolicyTest do
|
||||
alias Pleroma.Web.ActivityPub.MRF.InlineQuotePolicy
|
||||
alias Pleroma.Object
|
||||
use Pleroma.DataCase
|
||||
|
||||
setup_all do
|
||||
|
@ -24,6 +25,9 @@ defmodule Pleroma.Web.ActivityPub.MRF.InlineQuotePolicyTest do
|
|||
}
|
||||
}
|
||||
|
||||
# Prefetch the quoted post
|
||||
%Object{} = Object.normalize(quote_url, fetch: true)
|
||||
|
||||
{:ok, %{"object" => %{"content" => filtered}}} = InlineQuotePolicy.filter(activity)
|
||||
|
||||
assert filtered ==
|
||||
|
|
Loading…
Reference in New Issue