diff --git a/VKAPI/Handlers/Audio.php b/VKAPI/Handlers/Audio.php index 413a2a3a..004daef4 100644 --- a/VKAPI/Handlers/Audio.php +++ b/VKAPI/Handlers/Audio.php @@ -485,7 +485,7 @@ final class Audio extends VKAPIRequestHandler $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 e906ce50..d82194cf 100644 --- a/Web/Presenters/VKAPIPresenter.php +++ b/Web/Presenters/VKAPIPresenter.php @@ -234,8 +234,14 @@ final class VKAPIPresenter extends OpenVKPresenter } 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