Fixed returning empty array when positing json (issue #413)

This commit is contained in:
Simon Sessingo
2018-04-22 05:34:31 +02:00
parent 8653bfa86f
commit 4d842d0583
4 changed files with 154 additions and 171 deletions
+6 -10
View File
@@ -298,17 +298,13 @@ class InputHandler
// Append POST data
$output += $_POST;
$contents = file_get_contents('php://input');
if (\in_array($this->request->getMethod(), ['put', 'patch', 'delete'], false) === true) {
$contents = file_get_contents('php://input');
// Append any PHP-input json
if (strpos(trim($contents), '{') === 0) {
$post = json_decode($contents, true);
if ($post !== false) {
$output += $post;
}
// Append any PHP-input json
if (strpos(trim($contents), '{') === 0) {
$post = json_decode($contents, true);
if ($post !== false) {
$output += $post;
}
}
}