Allow apiresult to receive a string directly

This commit is contained in:
Bofh 2022-11-28 16:42:58 +01:00
parent 10112d1485
commit 5c1b1fb329
1 changed files with 4 additions and 1 deletions

View File

@ -36,7 +36,10 @@ function apiresult($data, $code=200) {
}
if ($code !== 200) http_response_code($code);
header('Content-Type: application/json');
echo json_encode($data); die;
if (gettype($data) !== 'string')
echo json_encode($data);
else echo $data;
die;
}
function instance_config($software, $instance=null) {