diff --git a/application/controllers/Api.php b/application/controllers/Api.php index 0993d809..0d6c3e51 100644 --- a/application/controllers/Api.php +++ b/application/controllers/Api.php @@ -421,7 +421,10 @@ class API extends CI_Controller { // Decode JSON and store $obj = json_decode(file_get_contents("php://input"), true); - + if ($obj === NULL) { + echo json_encode(['status' => 'failed', 'reason' => "wrong JSON"]); + die(); + } if(!isset($obj['key']) || $this->api_model->authorize($obj['key']) == 0) { http_response_code(401);