From 4a69059e1b968ce38d58d2ec53158ddd90fd0e98 Mon Sep 17 00:00:00 2001 From: Kakysha Date: Tue, 15 Sep 2015 01:34:01 +0300 Subject: [PATCH] Edit json and jsonb types in textarea --- adminer/call.inc.php | 2 +- adminer/include/functions.inc.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/adminer/call.inc.php b/adminer/call.inc.php index befd36c1..cc64027a 100644 --- a/adminer/call.inc.php +++ b/adminer/call.inc.php @@ -29,7 +29,7 @@ if (!$error && $_POST) { $call[] = (isset($out[$key]) ? "@" . idf_escape($field["field"]) : $val); } - $query = (isset($_GET["callf"]) ? "SELECT" : "CALL") . " " . (isset($_GET["ns"]) ? idf_escape($_GET["ns"]) . "." : "" ) . idf_escape($PROCEDURE) . "(" . implode(", ", $call) . ")"; + $query = (isset($_GET["callf"]) ? "SELECT" : "CALL") . " " . table($PROCEDURE) . "(" . implode(", ", $call) . ")"; echo "

" . h($query) . " " . lang('Edit') . "\n"; if (!$connection->multi_query($query)) { diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index b38a2b6b..8bde16d4 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -907,7 +907,7 @@ function input($field, $value, $function) { $attrs .= " cols='30' rows='$rows'" . ($rows == 1 ? " style='height: 1.2em;'" : ""); // 1.2em - line-height } echo "" . h($value) . ''; - } elseif ($function == "json") { + } elseif ($function == "json" || preg_match('~^jsonb?$~', $field["type"])) { echo "" . h($value) . ''; } else { // int(3) is only a display hint