From 07b65584ff6a7f3ef750a01d4f915a3d08b17f18 Mon Sep 17 00:00:00 2001 From: Eliseu Amaro Date: Mon, 3 Jan 2022 17:58:48 +0000 Subject: [PATCH] [COMPONENTS][Posting] Replaced is_int() with is_numeric(), casting target to int when using Actor getter From php-stan: is int with string evaluates to false Thus, the change was made in order to behave as intended --- components/Posting/Posting.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/Posting/Posting.php b/components/Posting/Posting.php index b06b3694b8..f38ee21f15 100644 --- a/components/Posting/Posting.php +++ b/components/Posting/Posting.php @@ -46,7 +46,6 @@ use App\Util\Formatting; use Component\Attachment\Entity\ActorToAttachment; use Component\Attachment\Entity\AttachmentToNote; use Component\Conversation\Conversation; -use Component\Group\Entity\LocalGroup; use Component\Language\Entity\Language; use Functional as F; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; @@ -253,7 +252,7 @@ class Posting extends Component DB::persist($activity); if (!\is_null($target)) { - $target = \is_int($target) ? Actor::getById($target) : $target; + $target = is_numeric($target) ? Actor::getById((int) $target) : $target; $mentions[] = [ 'mentioned' => [$target], 'type' => match ($target->getType()) {