Allow apiresult to receive a string directly
This commit is contained in:
parent
10112d1485
commit
5c1b1fb329
5
base.php
5
base.php
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue