mirror of
https://github.com/openvk/openvk
synced 2024-12-22 16:42:32 +03:00
fix audio.add (#1121)
* fix audio.add * Fix settype to allow Null * thx celestora <3 * Finaly, Tarhun
This commit is contained in:
parent
8786bd36fb
commit
9d62bfc12e
2 changed files with 9 additions and 3 deletions
|
@ -485,7 +485,7 @@ final class Audio extends VKAPIRequestHandler
|
||||||
$this->requireUser();
|
$this->requireUser();
|
||||||
$this->willExecuteWriteAction();
|
$this->willExecuteWriteAction();
|
||||||
|
|
||||||
if(!is_null($album_id))
|
if(!is_null($album_id))
|
||||||
$this->fail(10, "album_id not implemented");
|
$this->fail(10, "album_id not implemented");
|
||||||
|
|
||||||
// TODO get rid of dups
|
// TODO get rid of dups
|
||||||
|
|
|
@ -234,8 +234,14 @@ final class VKAPIPresenter extends OpenVKPresenter
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
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) {
|
} catch (\Throwable $e) {
|
||||||
// Just ignore the exception, since
|
// Just ignore the exception, since
|
||||||
// some args are intended for internal use
|
// some args are intended for internal use
|
||||||
|
|
Loading…
Reference in a new issue