diff --git a/includes/Wpup/UpdateServer.php b/includes/Wpup/UpdateServer.php index b868f36..f6c6530 100644 --- a/includes/Wpup/UpdateServer.php +++ b/includes/Wpup/UpdateServer.php @@ -256,9 +256,13 @@ protected function filterLogInfo($columns) { */ protected function outputAsJson($response) { header('Content-Type: application/json'); - $output = json_encode($response); - if ( function_exists('wsh_pretty_json') ) { - $output = wsh_pretty_json($output); + $output = ''; + if ( defined('JSON_PRETTY_PRINT') ) { + $output = json_encode($response, JSON_PRETTY_PRINT); + } elseif ( function_exists('wsh_pretty_json') ) { + $output = wsh_pretty_json(json_encode($response)); + } else { + $output = json_encode($response); } echo $output; }