diff --git a/src/Pecee/Http/Input/InputHandler.php b/src/Pecee/Http/Input/InputHandler.php index 79bd672..30527d6 100644 --- a/src/Pecee/Http/Input/InputHandler.php +++ b/src/Pecee/Http/Input/InputHandler.php @@ -79,8 +79,8 @@ public function parseInputs(): void if (strpos(trim($contents), '{') === 0) { $post = json_decode($contents, true); - if ($post !== false) { - $this->originalPost += $post; + if (json_last_error() === JSON_ERROR_NONE) { + $this->originalPost += is_array($post) ? $post : [$post]; } } else { $post = [];