From 33b69ed82bd903c9221c3d743a10879e0ad983e8 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Tue, 18 Mar 2025 11:12:07 +0100 Subject: [PATCH] Edit: prefer JSON over text --- adminer/include/html.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adminer/include/html.inc.php b/adminer/include/html.inc.php index dee59aa7..ba8d1835 100644 --- a/adminer/include/html.inc.php +++ b/adminer/include/html.inc.php @@ -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 ""; + } elseif ($function == "json" || preg_match('~^jsonb?$~', $field["type"])) { + echo "" . h($value) . ''; } 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 "" . h($value) . ''; - } elseif ($function == "json" || preg_match('~^jsonb?$~', $field["type"])) { - echo "" . h($value) . ''; } else { // int(3) is only a display hint $types = $driver->types();