Changed http code parameter order

This commit is contained in:
Bofh 2021-11-26 01:40:12 +01:00
parent 6171363041
commit 498627051c
1 changed files with 3 additions and 3 deletions

View File

@ -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);
}