summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
Diffstat (limited to 'it.class')
-rw-r--r--it.class4
1 files changed, 2 insertions, 2 deletions
diff --git a/it.class b/it.class
index f9c5846..aaca191 100644
--- a/it.class
+++ b/it.class
@@ -1139,9 +1139,9 @@ static function json_encode($data)
/**
* Decodes json data and provides warning if failed
*/
-static function json_decode($json)
+static function json_decode($json, $p = [])
{
- return ($data = json_decode($json)) === null && $json != 'null' ? it::error(array('title' => "invalid json", 'body' => $json)) : $data;
+ return ($data = json_decode($json)) === null && $json != 'null' ? it::error((array)$p['it_error'] + ['title' => "invalid json", 'body' => $json]) : $data;
}
/**