From b2d389a7b8128a6647dbe69c91cb53cb15bcecc5 Mon Sep 17 00:00:00 2001 From: mrilyew <99399973+mrilyew@users.noreply.github.com> Date: Fri, 23 May 2025 21:28:01 +0300 Subject: [PATCH] fix(video api): fix items bug --- VKAPI/Handlers/Video.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/VKAPI/Handlers/Video.php b/VKAPI/Handlers/Video.php index f8cecf05..43d7a468 100755 --- a/VKAPI/Handlers/Video.php +++ b/VKAPI/Handlers/Video.php @@ -20,12 +20,18 @@ final class Video extends VKAPIRequestHandler $this->requireUser(); if (!empty($videos)) { - $vids = explode(',', $videos); + $vids = array_unique(explode(',', $videos)); + + if (sizeof($vids) > 100) { + $this->fail(15, "Too many ids given"); + } + $profiles = []; $groups = []; + $items = []; + foreach ($vids as $vid) { $id = explode("_", $vid); - $items = []; $video = (new VideosRepo())->getByOwnerAndVID(intval($id[0]), intval($id[1])); if ($video && !$video->isDeleted()) {