From df4b93a72b688cbf0487558d4f67a9d8aaa754d2 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Wed, 15 Apr 2020 13:53:34 +0200 Subject: allow disabling pretty printing --- it.class | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/it.class b/it.class index 5190bde..a6e387b 100644 --- a/it.class +++ b/it.class @@ -1158,11 +1158,11 @@ static function pipe($cmd, $args = array()) /** * Encodes data to json with unescaped slahes, unescape unicode and on devel pretty printing - * @param $p['pretty'] Pretty-print json + * @param $p['pretty'] Force enable or disable pretty printing */ static function json_encode($data, $p = []) { - return json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | ($p['pretty'] || it::is_devel() ? JSON_PRETTY_PRINT : 0)); + return json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | ($p['pretty'] ?? it::is_devel() ? JSON_PRETTY_PRINT : 0)); } /** -- cgit v1.2.3