diff options
-rw-r--r-- | it.class | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1138,10 +1138,11 @@ static function json_encode($data) /** * Decodes json data and provides warning if failed + * $p['assoc'] Return objects as assoc arrays */ static function json_decode($json, $p = []) { - return ($data = json_decode($json)) === null && $json != 'null' ? it::error((array)$p['it_error'] + ['title' => "invalid json", 'body' => $json]) : $data; + return ($data = json_decode($json, $p['assoc'])) === null && $json != 'null' ? it::error((array)$p['it_error'] + ['title' => "invalid json", 'body' => $json]) : $data; } /** |