fix getting set to null if e.g. base64 images is sent in request json

This commit is contained in:
Harald Bamberger
2025-05-30 12:34:18 +02:00
parent 42b750e120
commit b885a8c72d
+5 -2
View File
@@ -81,8 +81,11 @@ class FHCAPI_Controller extends Auth_Controller
// For JSON Requests (as opposed to multipart/form-data) get the $_POST variable from the input stream instead
if ($this->input->get_request_header('Content-Type', true) == 'application/json')
$_POST = json_decode($this->security->xss_clean($this->input->raw_input_stream), true);
elseif (isset($_POST['_jsondata'])) {
{
$_POST = json_decode($this->input->raw_input_stream, true);
}
elseif (isset($_POST['_jsondata']))
{
$_POST = array_merge($_POST, json_decode($_POST['_jsondata'], true));
unset($_POST['_jsondata']);
}