diff options
author | rinpatch <rinpatch@sdf.org> | 2019-12-08 16:36:22 +0300 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2019-12-08 16:46:18 +0300 |
commit | a21340caa192b41051abe3b5905fbcb2fde281d7 (patch) | |
tree | a74f9b7f8ac835ba17541b83d092280deb11561d | |
parent | cdff5b82670313e46c2b362d4cf041779af6a6bd (diff) | |
download | pleroma-a21340caa192b41051abe3b5905fbcb2fde281d7.tar.gz |
Fix never matching clause
`length/1` is only used with lists.
-rw-r--r-- | lib/pleroma/clippy.ex | 1 | ||||
-rw-r--r-- | lib/pleroma/html.ex | 1 | ||||
-rw-r--r-- | lib/pleroma/web/activity_pub/transmogrifier.ex | 2 |
3 files changed, 3 insertions, 1 deletions
diff --git a/lib/pleroma/clippy.ex b/lib/pleroma/clippy.ex index bd20952a6..6e6121d4e 100644 --- a/lib/pleroma/clippy.ex +++ b/lib/pleroma/clippy.ex @@ -4,6 +4,7 @@ defmodule Pleroma.Clippy do @moduledoc false + # No software is complete until they have a Clippy implementation. # A ballmer peak _may_ be required to change this module. diff --git a/lib/pleroma/html.ex b/lib/pleroma/html.ex index 997e965f0..71c53ce0e 100644 --- a/lib/pleroma/html.ex +++ b/lib/pleroma/html.ex @@ -163,6 +163,7 @@ defmodule Pleroma.HTML.Scrubber.Default do require FastSanitize.Sanitizer.Meta alias FastSanitize.Sanitizer.Meta + # credo:disable-for-previous-line # No idea how to fix this one⦠diff --git a/lib/pleroma/web/activity_pub/transmogrifier.ex b/lib/pleroma/web/activity_pub/transmogrifier.ex index ce95fb6ba..ecba27bef 100644 --- a/lib/pleroma/web/activity_pub/transmogrifier.ex +++ b/lib/pleroma/web/activity_pub/transmogrifier.ex @@ -387,7 +387,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do def handle_incoming(%{"id" => nil}, _options), do: :error def handle_incoming(%{"id" => ""}, _options), do: :error # length of https:// = 8, should validate better, but good enough for now. - def handle_incoming(%{"id" => id}, _options) when not (is_binary(id) and length(id) > 8), + def handle_incoming(%{"id" => id}, _options) when is_binary(id) and byte_size(id) < 8, do: :error # TODO: validate those with a Ecto scheme |