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->willExecuteWriteAction();
|
||||
|
||||
if(!is_null($album_id))
|
||||
if(!is_null($album_id))
|
||||
$this->fail(10, "album_id not implemented");
|
||||
|
||||
// TODO get rid of dups
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue