throw if we don't get the upload_url

This commit is contained in:
ralf 2024-03-04 16:13:45 +02:00
parent 938aaa531a
commit 1e45b8dd9a

View File

@ -455,7 +455,12 @@ function do_upload()
if (empty($config['upload_url']))
{
$response = github_api("/repos/EGroupware/egroupware/releases", array(), 'GET');
$response = github_api("/repos/EGroupware/egroupware/releases", [], 'GET');
if (empty($response[0]['upload_url']))
{
throw new Exception("github_api('/repos/EGroupware/egroupware/releases', [], 'GET') responded with ".
json_encode($response, JSON_UNESCAPED_SLASHES));
}
$config['upload_url'] = preg_replace('/{\?[^}]+}$/', '', $response[0]['upload_url']); // remove {?name,label} template
}