From 2e327433a67488a6c240d6986456612e9bebd25f Mon Sep 17 00:00:00 2001 From: NoPlagiarism <37241775+NoPlagiarism@users.noreply.github.com> Date: Mon, 12 Dec 2022 04:13:55 +0500 Subject: [PATCH] requireUser in getCounters and createComment --- VKAPI/Handlers/Account.php | 2 ++ VKAPI/Handlers/Wall.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/VKAPI/Handlers/Account.php b/VKAPI/Handlers/Account.php index b05e01bd..2b9f88a3 100644 --- a/VKAPI/Handlers/Account.php +++ b/VKAPI/Handlers/Account.php @@ -67,6 +67,8 @@ final class Account extends VKAPIRequestHandler function getCounters(string $filter = ""): object { + $this->requireUser(); + return (object) [ "friends" => $this->getUser()->getFollowersCount(), "notifications" => $this->getUser()->getNotificationsCount(), diff --git a/VKAPI/Handlers/Wall.php b/VKAPI/Handlers/Wall.php index 9297dcbc..47f48762 100644 --- a/VKAPI/Handlers/Wall.php +++ b/VKAPI/Handlers/Wall.php @@ -542,6 +542,8 @@ final class Wall extends VKAPIRequestHandler } function createComment(int $owner_id, int $post_id, string $message, int $from_group = 0) { + $this->requireUser(); + $post = (new PostsRepo)->getPostById($owner_id, $post_id); if(!$post || $post->isDeleted()) $this->fail(100, "One of the parameters specified was missing or invalid");