]> git.joonet.de Git - adminer.git/commitdiff
Edit json and jsonb types in textarea
authorKakysha <ezhikvdele@gmail.com>
Mon, 14 Sep 2015 22:34:01 +0000 (01:34 +0300)
committerJakub Vrana <jakub@vrana.cz>
Sun, 19 Feb 2017 09:02:51 +0000 (10:02 +0100)
adminer/call.inc.php
adminer/include/functions.inc.php

index befd36c192997019918fa283ab37b31523fe16c1..cc64027a971a2257bf6a930a0efbdfc09ce205e6 100644 (file)
@@ -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 "<p><code class='jush-$jush'>" . h($query) . "</code> <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>\n";
        
        if (!$connection->multi_query($query)) {
index b38a2b6bed4ee35979547a50f09d6df0e2c963a1..8bde16d4648838ba406e843593e51e413404fca7 100644 (file)
@@ -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 "<textarea$attrs>" . h($value) . '</textarea>';
-               } elseif ($function == "json") {
+               } elseif ($function == "json" || preg_match('~^jsonb?$~', $field["type"])) {
                        echo "<textarea$attrs cols='50' rows='12' class='jush-js'>" . h($value) . '</textarea>';
                } else {
                        // int(3) is only a display hint