disable(); // Always send the correct headers header('Content-type: application/json; charset=UTF-8'); // Save and forward the response only if in valid format $data = json_decode($response); if (is_object($data)) { $latestCompatible = PMA_Util::getLatestCompatibleVersion( $data->releases ); $version = ''; $date = ''; if ($latestCompatible != null) { $version = $latestCompatible['version']; $date = $latestCompatible['date']; } if ($save) { $_SESSION['cache']['version_check'] = array( 'response' => $response, 'timestamp' => time() ); } echo json_encode( array( 'version' => (! empty($version) ? $version : ''), 'date' => (! empty($date) ? $date : ''), ) ); } ?>