diff options
author | Mark Felder <feld@feld.me> | 2024-01-22 18:27:33 -0500 |
---|---|---|
committer | Mark Felder <feld@feld.me> | 2024-01-22 18:37:29 -0500 |
commit | 115b2ad63875b1dc92d194e7e17b6ccde3b3d395 (patch) | |
tree | 503cd288c7f0a596f26511ed5a5e4356c910f95d | |
parent | 0dd65246eac9c1c738cc4ea47798caec1797ad6d (diff) | |
download | pleroma-115b2ad63875b1dc92d194e7e17b6ccde3b3d395.tar.gz pleroma-115b2ad63875b1dc92d194e7e17b6ccde3b3d395.zip |
MRF.KeywordPolicy: fix dialyzer error
lib/pleroma/web/activity_pub/mrf/keyword_policy.ex:13:neg_guard_fail
Guard test:
not is_binary(_string :: binary())
can never succeed.
-rw-r--r-- | lib/pleroma/web/activity_pub/mrf/keyword_policy.ex | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/pleroma/web/activity_pub/mrf/keyword_policy.ex b/lib/pleroma/web/activity_pub/mrf/keyword_policy.ex index 874fe9ab9..729da4e9c 100644 --- a/lib/pleroma/web/activity_pub/mrf/keyword_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/keyword_policy.ex @@ -10,15 +10,12 @@ defmodule Pleroma.Web.ActivityPub.MRF.KeywordPolicy do @moduledoc "Reject or Word-Replace messages with a keyword or regex" @behaviour Pleroma.Web.ActivityPub.MRF.Policy - defp string_matches?(string, _) when not is_binary(string) do - false - end defp string_matches?(string, pattern) when is_binary(pattern) do String.contains?(string, pattern) end - defp string_matches?(string, pattern) do + defp string_matches?(string, %Regex{} = pattern) do String.match?(string, pattern) end |