summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it.class3
1 files changed, 2 insertions, 1 deletions
diff --git a/it.class b/it.class
index 89d799a..8209e65 100644
--- a/it.class
+++ b/it.class
@@ -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;
}
/**