From c3ebcabda37f3452ea03f2af978303c8719858b5 Mon Sep 17 00:00:00 2001 From: veselcraft Date: Sun, 27 Mar 2022 15:08:27 +0300 Subject: [PATCH] VKAPI: Fix error 500 on Users.search method --- VKAPI/Handlers/Users.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/VKAPI/Handlers/Users.php b/VKAPI/Handlers/Users.php index 705ff3fe..6832cc3c 100644 --- a/VKAPI/Handlers/Users.php +++ b/VKAPI/Handlers/Users.php @@ -158,13 +158,14 @@ final class Users extends VKAPIRequestHandler $users = new UsersRepo; $array = []; + $find = $users->find($q); - foreach ($users->find($q) as $user) { + foreach ($find as $user) { $array[] = $user->getId(); } return (object)[ - "count" => $users->getFoundCount($q), + "count" => $find->size(), "items" => $this->get(implode(',', $array), $fields, $offset, $count) ]; }