mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2025-01-05 14:58:40 +00:00
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.
This commit is contained in:
parent
0dd65246ea
commit
115b2ad638
1 changed files with 1 additions and 4 deletions
|
@ -10,15 +10,12 @@ defmodule Pleroma.Web.ActivityPub.MRF.KeywordPolicy do
|
||||||
@moduledoc "Reject or Word-Replace messages with a keyword or regex"
|
@moduledoc "Reject or Word-Replace messages with a keyword or regex"
|
||||||
|
|
||||||
@behaviour Pleroma.Web.ActivityPub.MRF.Policy
|
@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
|
defp string_matches?(string, pattern) when is_binary(pattern) do
|
||||||
String.contains?(string, pattern)
|
String.contains?(string, pattern)
|
||||||
end
|
end
|
||||||
|
|
||||||
defp string_matches?(string, pattern) do
|
defp string_matches?(string, %Regex{} = pattern) do
|
||||||
String.match?(string, pattern)
|
String.match?(string, pattern)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue