vk-php-sdk
vk-php-sdk copied to clipboard
PHP ошибка Argument 1 passed to VKApiError::__construct() must be of the type array, string given
В функции parseResponse после обработки в decode_body содержится следующий массив, где error передается не как массив, а как строка
Array ( [error] => ERR_UPLOAD_BAD_IMAGE_SIZE: market photo min size 400x400 [bwact] => do_add [server] => 854320 [_sig] => 0192528750fa266e7558211ed60ccaee )
из-за этого php падает с ошибкой
Uncaught TypeError: Argument 1 passed to VK\Client\VKApiError::__construct() must be of the type array, string given, called in ... VK/Client/VKApiRequest.php on line 131 and defined in ... VK/Client/VKApiError.php:27 Stack trace: #0 ... VK/Client/VKApiRequest.php(131): VK\Client\VKApiError->_construct('ERR_UPLOAD_BAD...') #1 ... VK/Client/VKApiRequest.php(110): VK\Client\VKApiRequest->parseResponse(Object(VK\TransportClient\TransportClientResponse)) #2 xyz.php(2): VK\Client\VKApiRequest->upload('https://pu1-28....', 'file', '/home/c/92524...')
Same error
У меня совершенно та же ошибка. Она возникает на файлы больше 5МБ. Видео 11МБ я не могу загрузить и фото тоже. Поддержка ВК ничего дельного не ответила.
Удалось побороть проблему?