Changed http code parameter order

master
Bofh 1 year ago
parent 6171363041
commit 498627051c

@ -13,14 +13,14 @@ function unquote($text) {
# HTTP result => JSON
function hres_json($code, $status, $message) {
header('Content-Type: application/json');
return hres(json_encode([
return hres($code, json_encode([
'status' => $status,
'message' => $message
]), $code);
]));
}
# HTTP result
function hres($message, $code=200) {
function hres($code, $message) {
http_response_code($code);
die($message);
}

Loading…
Cancel
Save