From 6fdd2a408e86408225fc3beddafccf1211d909a5 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Mon, 20 Nov 2017 03:35:08 +0000 Subject: [PATCH] www/dbq/dbq.php --- lib/php/nb.php | 3 +++ www/dbq/dbq.php | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/lib/php/nb.php b/lib/php/nb.php index 6f2bd03b..0868fbce 100644 --- a/lib/php/nb.php +++ b/lib/php/nb.php @@ -425,6 +425,9 @@ class NB { $_benchmark[$function] = microtime(true); } + public static function json_decode($v) { return json_decode($v); } + public static function json_encode($v) { return json_encode($v); } + /* * Function: object2array */ diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index caac82ed..5fa86d8e 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -649,6 +649,24 @@ EOF; $this->is_html = strpos($content_type,'html') ? true : false; $this->db->is_html = $this->is_html; + #if ( $format == 'json' and isset($_GET['json']) ) { + #bye($this->p('json')); + /* + if ( $format == 'json' and isset($_POST['json']) ) { + #bye($_POST['json']); + #$this->pset($this->json_decode($_POST['json'])); + $_POST = $this->json_decode($_POST['json']); + #bye($this->p()); + } + + if ( $format == 'json' and $this->p('json') ) { + #bye($this->p('json')); + #bye($this->json_decode($this->p('json'))); + #bye($this->json_decode('{"id": "2"}')); + $this->pset($this->json_decode($this->p('json'))); + } + */ + } public function phpinfo_rows() { -- 2.47.3