[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
This commit is contained in:
parent
4ae160b0f8
commit
07b65584ff
@ -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()) {
|
||||
|
Loading…
Reference in New Issue
Block a user