@required_description_keys [:key, :related_policy]
+ def filter_one(policy, %{"type" => type} = message)
+ when type in ["Undo", "Block", "Delete"] and
+ policy != Pleroma.Web.ActivityPub.MRF.SimplePolicy do
+ {:ok, message}
+ end
+
def filter_one(policy, message) do
should_plug_history? =
if function_exported?(policy, :history_awareness, 0) do
|> get_policies()
|> Enum.concat([
Pleroma.Web.ActivityPub.MRF.HashtagPolicy,
- Pleroma.Web.ActivityPub.MRF.InlineQuotePolicy
+ Pleroma.Web.ActivityPub.MRF.InlineQuotePolicy,
+ Pleroma.Web.ActivityPub.MRF.NormalizeMarkup
])
|> Enum.uniq()
end
# - https://extra.baddomain.net/
# Does NOT match the following:
# - https://maybebaddomain.net/
+
+ # *.baddomain.net
def subdomain_regex("*." <> domain), do: subdomain_regex(domain)
+ # baddomain.net
def subdomain_regex(domain) do
- ~r/^(.+\.)?#{Regex.escape(domain)}$/i
+ if String.ends_with?(domain, ".*") do
+ ~r/^(.+\.)?#{Regex.escape(String.replace_suffix(domain, ".*", ""))}\.(.+)$/i
+ else
+ ~r/^(.+\.)?#{Regex.escape(domain)}$/i
+ end
end
@spec subdomains_regex([String.t()]) :: [Regex.t()]