Closed seregazhuk closed 5 years ago
It fails when trying to upload a link that contains non-ASCII characters. For example:
$res = $bot->pins->create('https://wpapers.ru/wallpapers/animals/Cats/8651/PREV_Котик.jpg', $boardId, 'test');
The reason is that filter_var($imageUrl, FILTER_VALIDATE_URL) doesn't work with such strings. To fix it we can use file_exists() to check whether we should upload a local file or a link.
filter_var($imageUrl, FILTER_VALIDATE_URL)
file_exists()
It fails when trying to upload a link that contains non-ASCII characters. For example:
The reason is that
filter_var($imageUrl, FILTER_VALIDATE_URL)
doesn't work with such strings. To fix it we can usefile_exists()
to check whether we should upload a local file or a link.