From d183b1a8a3df8bb14f490b5473353443b4348ee3 Mon Sep 17 00:00:00 2001 From: veselcraft Date: Mon, 13 Nov 2023 12:37:15 +0300 Subject: [PATCH] compatibility fixxxxxx --- VKAPI/Handlers/Friends.php | 6 +++++- VKAPI/Handlers/Wall.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/VKAPI/Handlers/Friends.php b/VKAPI/Handlers/Friends.php index 56de3294..59cf5679 100644 --- a/VKAPI/Handlers/Friends.php +++ b/VKAPI/Handlers/Friends.php @@ -4,7 +4,7 @@ use openvk\Web\Models\Repositories\Users as UsersRepo; final class Friends extends VKAPIRequestHandler { - function get(int $user_id, string $fields = "", int $offset = 0, int $count = 100): object + function get(int $user_id = 0, string $fields = "", int $offset = 0, int $count = 100): object { $i = 0; $offset++; @@ -14,6 +14,10 @@ final class Friends extends VKAPIRequestHandler $this->requireUser(); + if ($user_id == 0) { + $user_id = $this->getUser()->getId(); + } + if (is_null($users->get($user_id))) { $this->fail(100, "One of the parameters specified was missing or invalid"); } diff --git a/VKAPI/Handlers/Wall.php b/VKAPI/Handlers/Wall.php index 693ca3cb..add2159b 100644 --- a/VKAPI/Handlers/Wall.php +++ b/VKAPI/Handlers/Wall.php @@ -802,7 +802,7 @@ final class Wall extends VKAPIRequestHandler return [ "type" => "photo", "photo" => [ - "album_id" => $attachment->getAlbum() ? $attachment->getAlbum()->getId() : NULL, + "album_id" => $attachment->getAlbum() ? $attachment->getAlbum()->getId() : 0, "date" => $attachment->getPublicationTime()->timestamp(), "id" => $attachment->getVirtualId(), "owner_id" => $attachment->getOwner()->getId(),