diff --git a/src/View/JsonView.php b/src/View/JsonView.php index 5af3d69e1ce..be1ad2f6baa 100644 --- a/src/View/JsonView.php +++ b/src/View/JsonView.php @@ -177,9 +177,8 @@ protected function _serialize($serialize) } if (Configure::read('debug')) { - return json_encode($data, $jsonOptions | JSON_PRETTY_PRINT); + $jsonOptions = $jsonOptions | JSON_PRETTY_PRINT; } - return json_encode($data, $jsonOptions); } }