Added the possibility of sending data to the "qso" method API also in www-x-form-urlencoded format to allow the automatic sending of QSOs via software such as Log4OM

这个提交包含在:
Emiliano Macedonio 2024-05-21 16:55:59 +02:00
父节点 d41e524dbd
当前提交 fc6b1966e3

查看文件

@ -193,8 +193,13 @@ 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();
// Decoding not valid try simple www-x-form-urlencoded
$objTmp = file_get_contents("php://input");
parse_str($objTmp, $obj);
if ($obj === NULL) {
echo json_encode(['status' => 'failed', 'reason' => "wrong JSON"]);
die();
}
}
if(!isset($obj['key']) || $this->api_model->authorize($obj['key']) == 0) {