]> git.joonet.de Git - adminer.git/commitdiff
Edit: prefer JSON over text
authorJakub Vrana <jakub@vrana.cz>
Tue, 18 Mar 2025 10:12:07 +0000 (11:12 +0100)
committerJakub Vrana <jakub@vrana.cz>
Tue, 18 Mar 2025 10:12:07 +0000 (11:12 +0100)
adminer/include/html.inc.php

index dee59aa7ff2d0e8679cab16f871fb3be4dc0492a..ba8d1835ec5421a0384c8fbbbb68c593eeb8709f 100644 (file)
@@ -290,6 +290,8 @@ function input($field, $value, $function, $autofocus = false) {
                        }
                } elseif (preg_match('~blob|bytea|raw|file~', $field["type"]) && ini_bool("file_uploads")) {
                        echo "<input type='file' name='fields-$name'>";
+               } elseif ($function == "json" || preg_match('~^jsonb?$~', $field["type"])) {
+                       echo "<textarea$attrs cols='50' rows='12' class='jush-js'>" . h($value) . '</textarea>';
                } elseif (($text = preg_match('~text|lob|memo~i', $field["type"])) || preg_match("~\n~", $value)) {
                        if ($text && JUSH != "sqlite") {
                                $attrs .= " cols='50' rows='12'";
@@ -298,8 +300,6 @@ function input($field, $value, $function, $autofocus = false) {
                                $attrs .= " cols='30' rows='$rows'" . ($rows == 1 ? " style='height: 1.2em;'" : ""); // 1.2em - line-height
                        }
                        echo "<textarea$attrs>" . h($value) . '</textarea>';
-               } 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
                        $types = $driver->types();