From 142c19c557e76a4b01168b52aa673a8d523ec546 Mon Sep 17 00:00:00 2001 From: Mark van Driel Date: Mon, 19 Aug 2019 15:00:19 +0200 Subject: [PATCH] Fix for: Empty post body for json will put null value in request->data --- lib/Cake/Controller/Component/RequestHandlerComponent.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Controller/Component/RequestHandlerComponent.php b/lib/Cake/Controller/Component/RequestHandlerComponent.php index df6ca78d0..1915b981a 100644 --- a/lib/Cake/Controller/Component/RequestHandlerComponent.php +++ b/lib/Cake/Controller/Component/RequestHandlerComponent.php @@ -220,7 +220,7 @@ class RequestHandlerComponent extends Component { foreach ($this->_inputTypeMap as $type => $handler) { if ($this->requestedWith($type)) { - $input = call_user_func_array(array($controller->request, 'input'), $handler); + $input = (array)call_user_func_array(array($controller->request, 'input'), $handler); $controller->request->data = $input; } }