commit: af5fef1f228a1781d7d9cad490d3b3a783389f5e
parent: 8404f8c8fbc4a60473df0977bc05e2587207d811
Author: rinpatch <rinpatch@sdf.org>
Date: Sun, 8 Dec 2019 13:50:57 +0000
Merge branch 'fix/clause-never-matches' into 'develop'
Fix never matching clause
See merge request pleroma/pleroma!2042
Diffstat:
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git 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
@@ -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
@@ -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