diff --git a/VKAPI/Handlers/Audio.php b/VKAPI/Handlers/Audio.php index 413a2a3a0..004daef49 100644 --- a/VKAPI/Handlers/Audio.php +++ b/VKAPI/Handlers/Audio.php @@ -485,7 +485,7 @@ function add(int $audio_id, int $owner_id, ?int $group_id = NULL, ?int $album_id $this->requireUser(); $this->willExecuteWriteAction(); - if(!is_null($album_id)) + if(!is_null($album_id)) $this->fail(10, "album_id not implemented"); // TODO get rid of dups diff --git a/Web/Presenters/VKAPIPresenter.php b/Web/Presenters/VKAPIPresenter.php index e906ce50e..d82194cf2 100644 --- a/Web/Presenters/VKAPIPresenter.php +++ b/Web/Presenters/VKAPIPresenter.php @@ -234,8 +234,14 @@ function renderRoute(string $object, string $method): void } try { - settype($val, $parameter->getType()->getName()); - $params[] = $val; + // Проверка типа параметра + $type = $parameter->getType(); + if (($type && !$type->isBuiltin()) || is_null($val)) { + $params[] = $val; + } else { + settype($val, $parameter->getType()->getName()); + $params[] = $val; + } } catch (\Throwable $e) { // Just ignore the exception, since // some args are intended for internal use